ReadLn not working...

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
wcgenzer
Newbie
Posts: 3
Joined: Tue Apr 08, 2003 8:20 pm

ReadLn not working...

Post by wcgenzer » Tue Apr 08, 2003 8:26 pm

Let>k=1
Label>start
ReadLn>C:\notes.txt,k,line
If>line=##EOF##,finish
Message>line
Let>k=k+1
Goto>start
Label>finish

I tried this script (which is copied almost exactly letter for letter from the help) with 7.1 and 7.2 beta and the only output I can get is 'line', not the actual data in the file... Anyone else having this problem? It also seems to be stuck in a never ending loop, it never hits the ##EOF##...

I even tried this:

ReadLn>C:\notes.txt,1,line
Message>line

which just shows a message with the word 'line', not the actual data thats on line 1 of the C:\notes.txt file...

User avatar
Captive
Macro Veteran
Posts: 213
Joined: Sun Oct 20, 2002 8:37 pm
Location: Colorado, USA

Post by Captive » Tue Apr 08, 2003 8:33 pm

Try: %line% ... "Message>%line%" and "If>%line%=##EOF##..." (etc)

Edit: I copy/pasted your script exactly in to v7.1.18, and it worked perfectly. The only thing I can think of, is that you have an extra space at the end of the line somewhere. In the script editor, select "Edit -> Show all chars" from the drop down menus, and see if any spaces accidently made it to the end of the lines.
Maybe you have: "Readln>c:\notes.txt,k,line " <-- with space?

wcgenzer
Newbie
Posts: 3
Joined: Tue Apr 08, 2003 8:20 pm

Post by wcgenzer » Tue Apr 08, 2003 8:53 pm

I tried the %line%, gave the same results, but then I went to the end of the line:

ReadLn>C:\notes.txt,k,line

and

Message>line

and removed the extra spaces at the end of each line, and it works!

Thanks a ton! I never would have thought to check for that :)

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