User Tools

Site Tools


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

#APPEND( file ) [, SECTION ]

blk2blue.jpg

#APPEND Adds the file contents to the end of the current source output destination file.
file A string constant, template symbol, or expression containing a DOS file specification. This may be a fully qualified DOS pathname.
SECTION Specifies the error position of embedded source code is correctly patched to reflect the actual position in the generated code.

The #APPEND statement adds the complete contents of the file to the end of the current source output destination file. The contents of the file are NOT interpreted for source generation purposes. Therefore, the file should not contain any Template Language code.

If the file does not exist, #APPEND is ignored and source generation continues.

Example:

#FOR(%Module)

 #SET(%TempModuleFile,(%Module & '.$$$'))          #!Set temp module file

 #CREATE(%TempModuleFile)                          #!Create temp module file

 #FOR(%ModuleProcedure)                            #!For all procs in module

   #FIX(%Procedure,%ModuleProcedure)               #!Fix current procedure

   #GENERATE(%Procedure)                           #!Generate procedure code

 #ENDFOR                                           #!EndFor all procs in module

 #SET(%ModuleFile,(%Module & '.CLW'))              #!Set to current module file

 #CREATE(%ModuleFile)                              #!Create module file

 #GENERATE(%Module)                                #!Generate module header

#APPEND(%TempModuleFile),SECTION                  #!Add generated procedures

#ENDFOR

See Also:     #SECTION

append_add_to_source_file_.htm.txt · Last modified: 2021/04/15 15:56 by 127.0.0.1