User Tools

Site Tools


close_close_source_file_.htm
Navigation:  Templates > Template Language Reference > Complete Alpha Listing >====== #CLOSE (close source file) C6H0068.jpg ====== Previous pageReturn to chapter overviewNext page

#CLOSE( [file] ) [, READ ]

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 ,#READ ,#CREATE

close_close_source_file_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1