read_read_one_line_of_a_source_file_.htm
Navigation: Templates > Template Language Reference > Complete Alpha Listing >====== #READ (read one line of a source file) ====== | |
#READ( symbol )
#READ | Reads the next record from the opened read-only file. |
symbol | The symbol to receive the text from the file. |
The #READ statement reads the next record (up to the next CR/LF encountered) from open read-only file. The symbol receives the text from the file. If the last record has been read, the symbol will contain a value equivalent to the %EOF built-in symbol.
Example:
#OPEN(%ProgramFile),READ #!Open it in read-only mode
#DECLARE(%ASCIIFileRecord)
#LOOP
#READ(%ASCIIFileRecord)
#IF(%ASCIIFileRecord = %EOF)
#BREAK
#ENDIF
#! Parse the line and do something with it
#ENDLOOP
#CLOSE(%ProgramFile),READ #!Close the read-only file
read_read_one_line_of_a_source_file_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1