ReadLn not finding file

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
redlogic

ReadLn not finding file

Post by redlogic » Wed Nov 05, 2003 3:37 pm

I'm using version 7.2.036, and this is the problem.


ReadLn>c:\employee.txt,Line,my_line
If>my_line=##EOF##,finish
If>my_line=##NOFILE##,nofile

label>nofile
messagemodal>No File Found



It keeps telling me that the file is not found. I've even tried:


Let>inputfile="c:\employee.txt"
ReadLn>%inputfile%,Line,my_line
If>my_line=##EOF##,finish
If>my_line=##NOFILE##,nofile

label>nofile
messagemodal>No File Found



I've checked everything but the weather, and can't get it to work. Any help would be most appreciated.

Thanks

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

Post by support » Wed Nov 05, 2003 5:14 pm

Hi,

Yes, well, I hope it DOES tell you that the file is not found. Because that is what your script is supposed to do. Read each line one by one just as Macro Scheduler does:

ReadLn>c:\employee.txt,Line,my_line

-- Read line number 'Line' (invalid numeric, unless you have defined Line elsewhere but didn't copy it here) from the file.

If>my_line=##EOF##,finish

-- Does the line equal ##EOF## if so go to finish otherwise continue

If>my_line=##NOFILE##,nofile

-- If the line is ##NOFILE## then go to nofile otherwise continue

label>nofile

-- we are here and we will get here in every circumstance EXCEPT my_line being equal to ##EOF##.

messagemodal>No File Found

-- display No File Found

See how the message 'No File Found' will be displayed EVERY time EXCEPT when we get ##EOF##

I doubt this is what you really wanted.
MJT Net Support
[email protected]

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