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> readln read and skip line pp 110</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 READLN                      Read and Skip Line                       pp 110

 Syntax:  ReadLn (FileVar, Var1, Var2,...VarN) ;

 Type:    Any

 Form:    Procedure

 Purpose:  Input data to variables.

 Notes:    This procedure is identical to Read except that after the last
           variable has been read, the remainder of the line is skipped and
           the line pointer is positioned to read the next line.
           When reading from the console, the terminating Cr/Lf sequence is
           echoed to the screen.  Read does not echo the Cr/Lf sequence.


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


 Usage:
       TYPE
          FileType = String [80]             ;  { Define record size  }
       VAR
          FileVar  : File of FileType        ;  { 80 byte record type }
          FileText : String [255]            ;  { Input text variable }
       CONST
          FileName : String [8] = 'Name.Ext' ;  { Constant file name  }

       BEGIN
           Assign (FileVar,FileName)         ;  { Assign file name    }
           Reset  (FileVar)                  ;  { Open file handle    }
           ReadLn (FileVar, FileText)        ;  { Read the text       }
       END.

See Also: Eof Eoln Read Write WriteLn

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