Was this helpful?
Components of Template Files
Template files are made up of several components. The components of a template file are:
Substitution variables
Global substitution variables that represent various components and specifications of a frame. Any string beginning with a "$" is read as a substitution variable. Substitution variables are represented here as $variable.
Logicals or environment variables
A variable set outside of Ingres. Any string beginning with "$$" is read as a logical or environment variable. They are represented here as $$logical.
"Template language" executable statements
Executable statements in a template language tell Vision how to generate the code. Lines beginning with "##" are template language executable statements.
The code generator converts these statements into 4GL source code; the "##" statements do not appear in the generated source code. For more information on template language statements, see Template Files Reference.
4GL code
Code inserted as is into the generated code. 4GL code can include any standard 4GL statements.
The following sections describe how you can use these components to customize your template files. You can:
Change or add 4GL code
Change or add template language code, including defining new substitution variables
For a complete list of substitution variables and template language statements, see Template Files Reference.
Format
The code generator determines the type of component by its format. Therefore, if you make any changes to a template file, you must observe the formatting rules, or Vision cannot generate the 4GL code.
The code generator keeps track of blanks and white space in a template language executable statement and reproduces those blanks and white space prior to any generated 4GL code for that statement.
Follow the existing layout to ensure that the generated code is properly indented and easy to read.
An Example of Template File Code
The following is a sample fragment of a template file for an Update frame with a Master and Detail table:
## IF $delete_master_allowed THEN
## INCLUDE inmsdlmn.tf --Delete menuitem
## ENDIF
The code generator interprets this code as follows:
The "##" on each line indicates an executable template language statement
The first line begins an executable if-then statement
The substitution variable $delete_master_allowed is a boolean that returns TRUE if the frame definition lets users delete records from the Master table
## INCLUDE on the second line is an executable statement to include and process another template file if deletions are allowed
"inmsdlmn.tf" is the name of the included template file that generates a Delete menu item
The text "--Delete menuitem" is a template file comment to document the purpose of this line; this text does not appear in the generated code
##ENDIF indicates the end of the executable if-then statement
Last modified date: 08/28/2024