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 )

 

Parameter:

Description:

fileNumber

The opened file-number identified by one of the Open file methods.

 

Example:

'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VARIABLES: lineString   Type: String
VARIABLES: fileNumber   Type: Integer
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  Open file for Read Only access.
fileNumber = fileManager.OpenRead( "C:\FileToOpen.txt" )
 
'  When a file-number > 0 is available, . . .
If fileNumber > 0 THEN
  '  Loop reading lines until we reach the
  '  end of the file marker.
  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 '  fileNumber > 0
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Returns:

endReached is set to TRUE when the End-of-File marker is reached.

 

Links:

OpenRead, ReadLine

See Also:

File Manager

 


Edit Time: 9/25/2017 09:09:58 AM


Topic ID#: 279

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software