User Tools

Site Tools


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) C6H0068.jpg ====== Previous pageReturn to chapter overviewNext page

#READ( symbol )

blk2blue.jpg

#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

See Also:     #OPEN ,#CLOSE

read_read_one_line_of_a_source_file_.htm.txt · Last modified: 2021/04/15 15:57 (external edit)