Navigation: Templates > Template Language Reference > Complete Alpha Listing >====== #GENERATE (generate source code section) ====== | |
#GENERATE( section )
#GENERATE | Generates a section of the application. |
section | One of the following built-in symbols: %Program, %Module, or %Procedure. This symbol indicates the portion of the application to generate. |
The #GENERATE statement generates the source code for the specified section of the application by executing the Template Language statements contained within that section. #GENERATE should only be used within the #APPLICATION or a #UTILITY section of the Template.
When section is:
%Program | The #PROGRAM section of the Template is generated. |
%Module | The appropriate #MODULE section of the Template is generated. |
%Procedure | The appropriate #PROCEDURE section of the Template for the current value of %Procedure is generated. |
Example:
#GENERATE(%Program) #!Generate program header
#FOR(%Module) #!
#GENERATE(%Module) #!Generate module header
#FOR(%ModuleProcedure) #!For all procs in module
#FIX(%Procedure,%ModuleProcedure) #!Fix current procedure
#GENERATE(%Procedure) #!Generate procedure code
#ENDFOR #!EndFor all procs in module
#ENDFOR #!EndFor all modules