INCLAN: readline: Difference between revisions

From CYANA Wiki
Jump to navigation Jump to search
m (1 revision)
No edit summary
 
Line 1: Line 1:
== Synopsis ==


Usage: readline ''file'' ''variable'' [close]
'''readline''' ''file'' ''variable'' ['''close''']


The statements "readline" reads one line from the given ''file''.
== Description ==
If necessary, the file is opened, from an already open file,
 
the next line is read. If the end-of-file is encountered the
Reads one line from a ''file'' and assigns it to a ''variable''. If the file is not yet open, it is opened and the first line is read. If the file is already open, the next line is read. If the end of the file is reached, the variable is set to '''EOF''' and the file is closed. Optionally, the file can be '''closed''' after reading a line.
''variable'' is set to "EOF", and the file is closed. The file
is also closed if the "close" option is given.

Latest revision as of 17:35, 13 August 2009

Synopsis

readline file variable [close]

Description

Reads one line from a file and assigns it to a variable. If the file is not yet open, it is opened and the first line is read. If the file is already open, the next line is read. If the end of the file is reached, the variable is set to EOF and the file is closed. Optionally, the file can be closed after reading a line.