| **Navigation:**  [[templates.htm|Templates]] > [[tlrcontents.htm|Template Language Reference]] > Complete Alpha Listing >====== #CLOSE (close source file) {{c6h0068.jpg|C6H0068.jpg}} ====== | [[ clear clear single valued symbol .htm|{{btn_prev_n.gif|Previous page}}]][[tlrcontents.htm|{{btn_home_n.gif|Return to chapter overview}}]][[ code define a code template .htm|{{btn_next_n.gif|Next page}}]] | | || **#CLOSE(** [//file//] **) **[, **READ **] {{blk2blue.jpg|blk2blue.jpg}} | **#CLOSE** | Closes an open generated source code disk file. | | //file// | A string constant, template symbol, or expression containing a DOS file specification. This may be a fully qualified DOS pathname. If omitted, the current disk file receiving generated source code is closed. | | **READ** | Closes the read-only input file. | The **#CLOSE** statement closes an open disk file receiving the generated source code. If the //file// is omitted, the current disk file receiving generated source code is closed. If the //file// does not exist, or is already closed, a source generation error is produced. **Example:** **#SET(%NewProgramFile,(%Application & '.$$$'))    #!Temp new program filename** **#CREATE(%NewProgramFile)                         #!Create new program file** **#GENERATE(%Program)                              #!Generate main program header** **#CLOSE****(%NewProgramFile)                          #!Create new program file** **#OPEN(%ProgramFile),READ                         #!Open it in read-only mode** **#DECLARE(%ASCIIFileRecord)** **#LOOP** ** #READ(%ASCIIFileRecord)** ** #! Parse the line and do something with it** ** #IF(%ASCIIFileRecord = %EOF)** **  #BREAK** ** #ENDIF** **#ENDLOOP** **#CLOSE****(%ProgramFile),READ                        #!Close the read-only file** **See Also:     **[[ open open source file .htm|#OPEN]] ,[[ read read one line of a source file .htm|#READ]] ,[[ create create source file .htm|#CREATE]]