submenu Statement—Start a Menu Not Linked to a Form
This statement starts a menu not directly linked to a form.
Syntax
submenu
Description
The
submenu statement displays a menu, known as a
submenu, that is not directly linked to a displayed form. (Submenus linked with a form are displayed with the
display submenu statement and described in
Table Fields.) You can use a submenu as a nested menu inside a display loop or as a multi-item prompt without an attached form. Submenus can provide a greater level of detail to the user.
When the user selects a menu item operation in which a submenu is nested, the submenu replaces the original menu line for the form. The user can then choose an operation from the submenu. When the chosen operation is finished, the original menu line appears; there is no implicit looping for submenus.
The submenu statement signals the start of a submenu. You can use only the activate menuitem, activate frskey, and activate timeout statements to create submenu operations. (An activate timeout section does not define a menu line operation.) The activation sections for the operations must directly follow the submenu statement. The submenu ends with the last consecutive activate section. The submenu statement and its associated activate sections are called a submenu block.
Do not place any other statements or any comment lines between the submenu statement and the first activate section or between the activate sections themselves. The FRS assumes that any such statements or comments indicate the end of the submenu.
You cannot issue the resume menu or resume entry statement in a submenu block, nor use it to resume on a submenu. (Use the display submenu statement to resume on the submenu.)
Example—submenu statement:
Provide a submenu for the Select operation.
exec frs activate menuitem 'Select';
exec frs begin;
exec frs submenu;
exec frs activate menuitem 'Employee';
exec frs begin;
/* Select an employee record */
exec frs end;
exec frs activate menuitem 'Manager';
exec frs begin;
/* Select a manager record */
exec frs end;
exec frs end;