Was this helpful?
System-defined Substitution Variables
The code generator uses global substitution variables to represent information about the frame. You provide this information through the following Vision components:
The application flow diagram that specifies the frames that your application uses and how those frames are called
Visual query specifications. The visual query for each Append, Browse, and Update frame that provides basic information to generate the frame's form and database query
Menu items to call frames
Parameters passed between frames
4GL escape code; this code is incorporated into the source code file exactly as you have written it
Frame behavior specifications that control how users interact with the frame
Local variables that you have specified for the frame
There are two types of these substitution variables:
String variables
Boolean variables
The tables in the following sections list the substitution variables recognized by the code generator. You can use any of these variables when editing template files.
String Variables
String variables supply such information as the names of the Master and Detail table that the frame uses. The following variables are set to string values before the code is generated. You can use them for text substitution, or you can use them in ##if or ##ifdef statements.
$default_return_value
Returns a default value appropriate to the frame type:
0    for integer, float or money
''    for string or date
NULL for none
$detail_table_name
Specifies the detail table in the Visual Query
$form_name
Specifies the VISUAL FORMS EDITOR form
$frame_name
Specifies the current frame
$frame_type
Specifies the type of the current frame (Browse, Update, Append, or Menu)
$locks_held
Specifies the type of locking specified in the frame behavior. Returns one of the following values:
DBMS
Optimistic
None
$master_seqfld_cname
Specifies the table column that corresponds to the sequenced field on an Append frame
$master_seqfld_fname
Specifies the form field that appears as a sequenced field on an Append frame
$master_table_name
Specifies the Master table in the Visual Query
$short_remark
Specifies the short remark entered when the frame was created
$source_file_name
Specifies the frame's source file
$tblfld_name
Specifies the name of the Master or Detail table field on the form (always "iitf")
$template_file_name
Specifies the main template file used to generate the code (for example, msappend.tf)
Boolean Variables
Boolean variables generate code based on whether or not the frame functions in a specific way; for example, whether user qualifications are allowed on an Update frame. The following variables are set to either "0" (false) or "1" (true) before the code is generated. Most of these variables are set in the Visual Query and by frame behaviors. You can use these variables in ##if or ##ifdef statements.
$dbevent_code_exists
Specifies the frame contains On-Dbevent escape code
$default_start_frame
Specifies the default start-up frame for the application
$delete_allowed
(Update frames only) Specifies that deletes are allowed on either the Master or Detail table
$delete_cascades
Specifies that corresponding Detail table records must be deleted when a Master table record is deleted
$delete_dbmsrule
Specifies that when a user selects Delete on an Update frame with a Master and Detail table, the generated code deletes only the Master table row and allows the DBMS to delete the corresponding Detail table records
The default value is FALSE.
$delete_detail_allowed
(Update frames only) Specifies that detail table deletes are allowed
$delete_master_allowed
(Update frames only) Specifies that Master table deletes are allowed
$delete_restricted
(Update frames only) Specifies that Master table deletes are prohibited when corresponding Detail table rows exist
$insert_detail_allowed
(Update frames only) Specifies that detail table insertions are allowed
$insert_master_allowed
(Update frames only) Specifies that new Master table rows can be appended; causes an AddNew and AppendMode menu item to be generated
$join_field_displayed
Specifies that any of the join fields are displayed (used with the Update Cascades integrity rule for Update frames with Master and Detail tables)
$join_field_used
Specifies that any of the join fields are used on the form or in variables
$lookup_exists
Specifies that a Lookup table is included in the Visual Query
$master_in_tblfld
Specifies that the Master table is displayed as a table field (always false for a frame with a Detail table)
$master_seqfld_exists
Specifies that a sequenced field is specified for the Master table on an Append frame
$master_seqfld_displayed
Specifies that a sequenced field for the Master table on an Append frame is displayed on the form
$master_seqfld_used
Specifies that a sequenced field for the Master table on an Append frame is used on the form or in a variable
$nullable_master_key
(Update frames only) Specifies that any column of the Master table key is nullable
$nullable_detail_key
(Update frames only) Specifies that any column of the Detail table key is nullable
$singleton_select
Specifies that only one Master table row must be retrieved (no Next menu item is to be generated)
$tablefield_menu
Specifies that the menu items on a Menu frame are displayed as a table field
$timeout_code_exists
Specifies that the frame contains On-Timeout escape code
$update_cascades
(Update frames with Master and Detail tables) Specifies that corresponding Detail table records must be updated when a value in a join field is changed
$update_dbmsrule
Specifies that when a user selects Save on an Update frame, the generated code does not update the join fields in the Detail table, but rather allows the DBMS to apply those updates, based on changes to the corresponding columns of the Master table
$update_restricted
Specifies that the value of the join columns in a Master table record cannot be updated if corresponding Detail table records exist
$user_qualified_query
Specifies that users can enter runtime query qualifications on a Browse or Update frame
Last modified date: 08/28/2024