MENU STATEMENT/COMMAND

MENU displays the menu associated with the given menu ID so that the user can make a selection.  This is also referred to as the "menu operation".

The MENU statement/command terminates when a choice is made and no PERFORM statement is associated with the choice or when @MENU_ACTION has been set to "END" in a trigger performed for an item in the menu.  When the MENU statement/command terminates, the menu is removed from the screen unless the menu has been pasted on the screen prior to the execution of the MENU statement/command.

When an item is selected, its sequence number is stored in the system field @MENU_CHOICE.  The keyword is stored in the system field @MENU_KEYWORD.  The value of @MENU_ CHOICE or @MENU_KEYWORD can be examined to determine which menu item has been selected.

SYNTAX

MENU menu_id [KEEP] [{IF; UNLESS}clause] [iterate_clause]

menu_id

is an integer field that contains the menu ID returned by GENERATE.  This field is a valid integer user-defined field, a Global Storage (GS) field, or a system field.

KEEP

retains the window on the screen after the statement is executed.  This avoids the need to repaste the window before doing the next FILL or MENU statement.  Without KEEP, fields are displayed, cleared, then redisplayed with new values.

EXAMPLE

MENU @INTEGER

This statement/command displays the menu associated with the menu ID stored in @INTEGER and prompts for a selection.

SEE ALSO:  @MENU_ACTION, @MENU_CHOICE, @MENU_KEYWORD, @NEXT_ITEM, @HELP_CODE, @REFRESH_CODE, and System Fields (later in this section).

Generate Statement/Command    Flush Statement/Command