GENERATE STATEMENT/COMMAND

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

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

SYNTAX

GENERATE menu_name TO menu_id [{IF; UNLESS} clause] [iterate_clause]

menu_name

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

menu_id

is an integer system field, GS field, or user-defined field where the new menu ID is stored.

EXAMPLE

GENERATE MENU1 TO @INTEGER

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

Text Substatement in Menu Layouts    Menu Statement/Command