[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 SEEKEOLN                    Test For End of Line                     pp 102

 Syntax:  SeekEoln (TextFileVar) ;

 Type:    Boolean

 Form:    Function

 Purpose: A Boolean function which returns True if the text file pointer is
          at the end of file or the end of the current file line.

 Notes:   Similar to SeekEoln except that blanks and tabs are skipped
          priot to testing for the end of line marker (CR/LF).

          SeekEoln can be used with Read to determine the current
          position in the file line of text.
          Read can become stuck at the end of the current
          line, as it does not advance the file pointer to the next line.
          ReadLn is used to advance the pointer to the next line.

 Usage:
      VAR
          TextFileVar  : Text                  ;  { Define a text file      }
          TextVar      : String [8]            ;  { Input variable          }

       BEGIN
           Assign (TextFileVar,'C:Name.Ext')   ;  { Assign file name        }
           Reset  (TextFileVar) ;              ;  { Open for processing     }
           While Not Eof (TextFileVar) Do         { Do until end of file    }
             Begin
             While Not SeekEoln (TextFileVar) Do  { Read current line   }
               Begin
               Read (TextFileVar, TextVar)     ;  { Read variable from file }
               End                             ;
             ReadLn                            ;  { Advance to next line    }
             End                               ;
           Close (TextFileVar) ;               ;  { Close the file          }
       END.

See Also: Eof Eoln Read ReadLn SeekEof
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson