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> seekeof test for end of file pp 102</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 SEEKEOF                     Test for End of File                     pp 102

 Syntax:  SeekEof (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.

 Notes:   Similar to Eof except that blanks, tabs, and CR/LF sequences
          are skipped prior to testing for end of file.


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


 Usage:
       VAR
          FileVar  : 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 SeekEof (FileVar)    ;  { Test for end of file }
           Close (FileVar)               ;  { Close the file       }
       END.

See Also: Eof Eoln Read ReadLn

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