EndOfFile

Top  Previous  Next

The EndOfFile function returns TRUE if the end of the file is reached after a sequence of ReadLine calls while reading a file previously opened with OpenRead.

 

Syntax

 

endReached = fileManager.EndOfFile( fileNumber )

 

Parameters

file Number

 

file number if more than one file has been opened.

 

 

 

returns

 

TRUE when the end of the file is reached

 

Example

VARIABLES: lineString TYPE: String

VARIABLES: fileNumber TYPE: Integer

 

' Open the file.

fileNumber = fileManager.OpenRead( "C:\FileToOpen.txt" )

 

IF fileNumber > 0 THEN

 

   ' Loop reading lines until we reach the

   ' end of the file.

   DO UNTIL fileManager.EndOfFile( fileNumber )

 

       ' Read a line from the current file.

       lineString = fileManager.ReadLine( fileNumber )

 

       ' Print the line

       PRINT lineString

 

   LOOP

 

   ' Close the file.

   fileManager.Close( fileNumber )

 

ENDIF