Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Pascal - <b> eof test for end of file pp 97</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 EOF                         Test For End Of File                      pp 97

 Syntax:  Eof (FileVar) ;

 Type:    Boolean

 Form:    Function

 Purpose: A Boolean function for all file types which returns True if the
           file pointer is at the end of the file or beyond.


 ----------------------------------------------------------------------------


 Usage:
       VAR
          FileVar  : File of Text        ;  { Define a text file   }
          TextLine : String [255]        ;  { Input variable       }

       BEGIN
           Assign (FileVar,'C:Name.Ext') ;  { Assign file name     }
           Reset  (FileVar)              ;  { Open for processing  }
           Repeat
              ReadLn (FileVar, TextLine) ;  { Read lines from file }
              Until Eof (FileVar)        ;  { Test for end of file }
           Close (FileVar)               ;  { Close the file       }
       END.

See Also: Eoln Read ReadLn SeekEof

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson