Hi,
Not to be a pain.
I'm doing a ReadLn and when get past the end of the file my variable is blank instead of ##EOF##
// Set the CurLineNumber past the end of file.
Let>CurLineNumber=10
ReadLn>D:\ResolutionSetup.txt,%CurLineNumber%,strLine
// NOTE: THIS NEVER OCCURS
If>strLine=##EOF##
If>CurLineNumber>1
Let>CurLineNumber=CurLineNumber-1
Message>You are past the Last Valid Setting/Line in the Setup.
ReadLn>D:\\ResolutionSetup.txt,%CurLineNumber%,strLine
Else
Message>No Lines In ResolutionSetup.Txt file.
exit>1
EndIf
EndIf
Message>%strLine%
When I run the above strLine is Blank even in Debug.
Any Ideas.
Thanks,
David
ReadLn No ##EOF##
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Perhaps line 10 IS a blank line. Perhaps the end of the file is further on than you think.
What happens if you run this script:
Eventually you should get a message box telling you what line the file ended at
What happens if you run this script:
Code: Select all
Let>CurLineNumber=1
Label>loop
ReadLn>D:\ResolutionSetup.txt,CurLineNumber,strLine
If>strLine=##EOF##
MessageModal>End of file at line: %CurLineNumber%
Goto>end
Endif
Let>CurLineNumber=CurLineNumber+1
Goto>Loop
Label>end
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Try this script also:
Code: Select all
ReadFile>D:\ResolutionSetup.txt,fileData
Separate>fileData,CRLF,fileLines
MessageModal>Number of lines in file %fileLines_count%
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?