Really sorry to bother everyone again here. But it just dawned on me here that I'm unsure how to determine when I hit the end of the file. I see in the doc for "read from file" that I can use that command in such a manner to read until EOF, but I am only reading line for line and am unsure if there's a way to toss a switch into my repeat to tell it to stop reading once EOF has been hit.
Any info appreciated.
Thanks again,
~Garrett
Using "for 1 line", determine EOF?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Using "for 1 line", determine EOF?
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Can I use the EOF constant without using it within the "read from file"? If so, does the EOF constant return anything like a 0 or 1 if EOF has been reached?
Like this:
Like this:
Code: Select all
if EOF is not empty then
answer "we've reached the end of the file so stop looping and get out of repeat loop now"
end if
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Hi Garrett,
from the dictionary:
regards
Bernd
from the dictionary:
So in your repeat loop you might want to test for the result like inIf the read from file command encounters the end of the file, the result function is set to "eof". If the command was successful and did not encounter the end of the file, the result function is set to empty.
Code: Select all
if the result is "eof" then exit repeat
Bernd