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
ReadLn not finding file
Moderators: JRL, Dorian (MJT support)
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.
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]
[email protected]