FutureBasic Logo

<<    Index    >> FutureBasic

eof   function

endReached = eof(fileID)

This function returns _zTrue if the "file mark" associated with the specified open file is positioned at the end of the file. The "file mark" is an internal pointer which is used by all operations which read from or write to the file; it indicates where in the file the next data should be read from or written to. You can move the file mark explicitly using the record statement; the file mark is also advanced automatically every time you do a read or write operation. Typically, you use the eof function when reading data sequentially, to determine when no more data can be read from the file.
If your program attempts to read data past the end of the file, FutureBasic returns an _endOfFile error to your program.

See also
error function; error statement; on error fn; on error fn/gosub; open; close; record; rec; pos; lof