Eof

File management function.

The Eof function determines if the end of the specified file has been reached.

Usage

Eof is used in loop constructions to detect the end of the file which is processed.

Syntax

Eof(<filename>)
or
var=Eof(<filename>)

Parameters

<filename>, string, name of the file to test.

Return value

var, numeric return code; if the end of the file has been reached, the return code is set to 1, otherwise 0. If <filename> is not open for reading or does not exist, 0 is returned (see statement Read).

Example

 

var = Eof("C:\my directory\my file.txt")