Menu properties in Console UI

You must specify the following common properties for a menu variable. These properties cannot be changed at run time.

Table 1. Properties that apply to menu variables
Property Description
labelKey The name of a field containing a key for searching the resource bundle that contains the label for the menu.
labelText STRING literal identifying a label for a menu.
The following property is unique to the menu variable:
menuItems
An array of menu items, each of which is declared in the program or is created dynamically with the keyword new.
  • Type: MenuItem[]
  • Example: menuItems = [myItem, new MenuItem {name = "Remove", labelText = "Delete all"}].
  • Default: none.
  • Updatable at run time? No
You can add a menu item to the program by using the following syntax:
  myMenu.MenuItems.addElement(myMenuItem)
myMenu
Name of the menu variable.
myMenuItem
Name of the menu item variable.

The program ends if you issue an openUI statement for a menu that contains no menu items.


Feedback