| **Navigation:**  [[templates.htm|Templates]] > [[tlrcontents.htm|Template Language Reference]] > Complete Alpha Listing >====== #READ (read one line of a source file) {{c6h0068.jpg|C6H0068.jpg}} ====== | [[ query conditionally generate source .htm|{{btn_prev_n.gif|Previous page}}]][[tlrcontents.htm|{{btn_home_n.gif|Return to chapter overview}}]][[ redirect change source file .htm|{{btn_next_n.gif|Next page}}]] | | || **#READ(** //symbol// **)** {{blk2blue.jpg|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 open source file .htm|#OPEN]] ,[[ close close source file .htm|#CLOSE]]