feof
- test for end-of-file

File Input/Output functions
(AmiBroker 4.50)


SYNTAX feof( filehandle )
RETURNS NUMBER
FUNCTION The feof function returns a nonzero value after the first read operation that attempts to read past the end of the file. It returns 0 if the current position is not end of file. There is no error return value.

filehandle is a file handle returned by fopen function.

EXAMPLE //
// The following code (commentary) reads
// all lines from the external file and
// displays it in commentary window

fh =
fopen( "quotes.csv", "r");
if( fh )
{
   
while( ! feof( fh ) )
   {
      
printf( fgets( fh ) );   
   }
}
else
{
   
printf("ERROR: file can not be found (does not exist)");
}


SEE ALSO fopen() function , fclose() function , fgets() function

References:

The feof function is used in the following formulas in AFL on-line library:

More information:

See updated/extended version on-line.