MENU programming steps
Follow this procedure to use the MENU
dialog instruction.
To implement a MENU
statement:
- Create a
MENU
block with a title and write the end of the menu block with theEND MENU
keywords. -
Depending on the type of menu rendering you need, add an
ATTRIBUTES
clause with the requiredSTYLE
attribute. - 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.
- According to TUI or GUI mode, define action views (topmenu,
toolbar or form buttons) for each menu action,
and use either
COMMAND [KEY]
orON ACTION
clauses 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 MENU
control instruction. - Implement the code to be executed in every option.