MENU programming steps
Follow this procedure to use the MENU dialog instruction.
To implement a MENU statement:
- Create a
MENUblock with a title and write the end of the menu block with theEND MENUkeywords. -
Depending on the type of menu rendering you need, add an
ATTRIBUTESclause with the requiredSTYLEattribute. - List all the options that you want to offer to the end user when the menu executes. Typical CRUD programs will implement "Append", "Modify", "Delete" operations for a given database application entity (customers, orders, items tables). Typical dialog box menus have "Yes" / "No" / "Cancel" options.
-
Whether TUI or GUI mode, define action views (
TOPMENU,TOOLBARor formBUTTON) for each menu action, and use eitherCOMMAND [KEY]orON ACTIONclauses to define the menu options. -
When the menu is not a pop-up or dialog menu, do not forget to implement an option to leave
the menu with the
EXIT MENUcontrol instruction. - Implement the code to be executed in every option.