EOF - determine if file is at end-of-file.

Usage:

var f: file of <type>;
...
eof(f)

Description:

EOF returns TRUE if file "f" is at end of file (i.e. no more data follows), and FALSE otherwise. For example, if you are using "read(ch)" to get the contents of a textfile, EOF will return TRUE if the next call to READ would result in encountering end of file.

End of file may be signalled on a textfile assigned to the terminal by typing a single line consisting of the ASCII FS (file separator) character. On most terminals, this is a control backslash ("cntl-\"). Note that invoking EOF may force a terminal read to occur.

If EOF is called with no arguments, the predeclared file variable "input" is tested.

It is an error to call EOF on a file that is not open.

Copyright © 1996, Thinkage Ltd.