At 5:38 PM -0500 12/5/00, Gregory Lypny wrote:
> I put the following version of the script through a trial run in an
>attempt to simply count the number of records in the file.
>
>put 0 into counter
>open file tDatapath for read
>repeat until it is eof
> read from file tDataPath until "//"
> add 1 to counter
>end repeat
>close file tDataPath
>put counter
>
> The script ran for about three minutes, and then everything just
>kind of stopped. The last statement was never executed. I'm wondering
>what I did wrong. Is the variable "it" in the repeat loop supposed to
>receive an end-of-file message?
I think eof is returned in the result. Try this:
put 0 into counter
open file tDatapath for read
repeat
read from file tDataPath until "//"
if the result is not empty then exit repeat
add 1 to counter
end repeat
close file tDataPath
put counter
This should jump out of the loop either after eof is reached, or an
error occurs.
Cheers
Dave Cragg
Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.