Partager via


FEOF( ) Function

Determines whether the file pointer is positioned at the end of a file.

FEOF(nFileHandle)

Return Values

Logical

Parameters

  • nFileHandle
    Specifies the file handle number of the file to check for the end-of-file condition. FEOF( ) always returns true (.T.) if you specify a file handle number of a communication port opened with FOPEN( ).

Remarks

This low-level file function returns true (.T.) if the file pointer is positioned at the end of a file opened with a low-level file function. FEOF( ) returns false (.F.) if the file pointer isn't at the end of the file.

Example

** Open the file test.txt **

gnFileHandle = FOPEN('test.txt')

** Move the file pointer to BOF **

gnPosition = FSEEK(gnFileHandle, 0)

** If file pointer is at BOF and EOF, the file is empty ** ** Otherwise the file must have something in it **

IF FEOF(gnFileHandle)
   WAIT WINDOW 'This file is empty!' NOWAIT
ELSE
   WAIT WINDOW 'This file has something in it!' NOWAIT
ENDIF
= FCLOSE(gnFileHandle)

See Also

FCHSIZE( ) | FCLOSE( ) | FCREATE( ) | FGETS( ) | FOPEN( ) | FPUTS( ) | FREAD( ) | FSEEK( ) | FWRITE( )