Problem with Writeln

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Prim
Newbie
Posts: 1
Joined: Wed Oct 19, 2005 6:36 pm

Problem with Writeln

Post by Prim » Wed Oct 19, 2005 7:39 pm

Hi, I am having some trouble with the writeln command.

I copy and paste some text from an application and write such text to a file. Everything works fine except when the text contains a comma.

For example, I get from the clipboard the text THIS IS MY TEXT then I write it to a file and works fine, but if I get THIS IS MY TEXT, HOPE IT WORKS FINE and I write it to the txt, when I open the file there is only HOPE IT WORKS FINE . All the text before the comma has gone. What's the problem? Am I doing anything wrong?

The text can have any other character but not a comma. I put the text into a variable prior to write it to the file, and if I show a message with the content of this variable the whole text appears. Trying to find a solution I tried things like this:

Let>pp=THIS IS MY TEXT, HOPE IT WORKS FINE
Writeln>file.txt,pp

Let>pp="THIS IS MY TEXT, HOPE IT WORKS FINE"
Writeln>file.txt,pp

Let>pp=THIS IS MY TEXT, HOPE IT WORKS FINE
Writeln>file.txt,%pp%

But I always get the same: HOPE IT WORKS FINE But doesn't work!!!!!

Please help me to resolve the problem.

I am sorry about my english, but I am from Spain.

Thanks.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Wed Oct 19, 2005 8:21 pm

Your syntax is wrong. WriteLn takes *three* parameters:

WriteLn>filename,result,line

So you should have:

Let>pp=THIS IS MY TEXT, HOPE IT WORKS FINE
Writeln>file.txt,RESULT,pp

RESULT contains the result of the WriteLn operation.
MJT Net Support
[email protected]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts