GENERATE STATEMENT/COMMAND

GENERATE checks the syntax of the statements in the LAYOUT SCREEN definition.  If the syntax is correct, the form described in LAYOUT SCREEN is created and a unique form ID is returned.  If a syntax error is found, an error message is displayed, and a form ID of zero is returned. GENERATE does not display the form on the screen, but it does compile it and store it in an internal table.

If GENERATE is the first screen-related statement executed in the ACCENT R session or is executed right after a SCREEN KILL_SCREEN statement/command, GENERATE clears the screen and the ACCENT R prompt appears at the top left corner of the screen.

SYNTAX

GENERATE form_name TO form_id [{IF; UNLESS} clause] [iterate_clause]

form_name

is the field name following the LAYOUT SCREEN statement.  If GENERATE is in a Process Module (PM), the form_name must be defined in the same PM or in a related Global Storage (GS).  If GENERATE is in a Command Module (CM) or executed as a single command, the form_name must be defined in a GS.

form_id

is an integer field that contains the new form ID returned by GENERATE.  This field can be any modifiable system field, GS field, or user-defined field.

EXAMPLE

GENERATE FORM1 TO @INTEGER

In this example, this PM statement checks the syntax of the statements between LAYOUT SCREEN FORM1 and LAYOUT END in the DECLARE SECTION.  This GENERATE statement must be a PM statement, because FORM1 is not a GS field.  If no syntax error is found, the GENERATE statement creates the form and stores the unique form ID in @INTEGER.

Back to Text Substatement    Next page Fill Statement/Command