EOF Function ---------------------------------------------------------------------------- Action For an ISAM table, tests whether the current position is at the end of a table. For a non-ISAM file, tests for the end-of-file condition. Syntax EOF( filenumber%) Remarks The argument filenumber% is the number used in the OPEN statement to open the file or ISAM table. The EOF function returns true (nonzero) if the end of a non-ISAM file has been reached or if the current position in an ISAM table is at the end of the table. The end of an ISAM table is the position immediately following the last record according to the current index. Use the EOF function with sequential files to test for the end of a file. This helps you avoid the Input past end of file error message. When used with random-access or binary files, EOF returns true if the last executed GET statement was unable to read an entire record. When you use EOF with a communications device, the definition of the end-of-file condition depends on the mode (ASCII or binary) in which you opened the device. In ASCII mode, EOF is false until you receive Ctrl+Z, after which it remains true until you close the device. In binary mode, EOF is true when the input queue is empty ( LOC( filenumber%)=0), where filenumber% is the number of the device. It becomes false when the input queue is not empty. Note EOF cannot be used with the BASIC devices SCRN, KYBD, CONS, LPT n, or PIPE. See Also BOF, LOC, LOF, OPEN Example See the INPUT# statement programming example, which uses the EOF function.