17. Forms Statements : display submenu Statement--Display a Submenu
 
Share this page                  
display submenu Statement--Display a Submenu
This statement initiates the display of a submenu.
Syntax
display submenu
Description
The display submenu statement provides a way to nest actions for a form. When a display submenu is started, the current set of actions is suspended. The suspended actions are reinstated after the display submenu exits.
You can nest a display submenu loop inside another display submenu loop, but the outermost loop must be inside a display loop. A display submenu loop looks and behaves exactly like a display loop. This means that activate field statements are allowed and the resume menu statement works just as it does in a display loop. For more information about display loops and display submenu loops, see Part 4: Embedded Forms Programming.
(If you want to put a menu on the screen that is not associated with any form, use the submenu statement. For information about submenus and how they differ from display submenus, see Part 4: Embedded Forms Programming. See also submenu Statement--Start a Menu Not Linked to a Form.)
Example--display submenu statement:
This example demonstrates using the display submenu statement to provide a submenu associated with the menu item fld1.
...
 exec frs activate menuitem 'fld1';
 exec frs begin;
 /* Start of a display submenu loop */
exec frs display submenu;
exec frs activate menuitem 'fldx';
exec frs begin;
     process field x;
exec frs end;
exec frs activate menuitem 'fldy';
exec frs begin;
     process field y;
     /* Exit display submenu with no validation */
     exec frs breakdisplay;
exec frs end;
exec frs activate menuitem 'end';
exec frs begin;
     /* Exit display submenu with validation */
     exec frs enddisplay;
 exec frs end;
     /* End of activation block for menuitem 'fld1' */
 exec frs end;