ITEM specifies an item for the menu and the item's text. The ITEM statement is repeated for each item in the menu. For each ITEM statement, there are three optional sub-statements: KEYWORD, PERFORM, and HELP. These sub-statements are described on the following pages.
When an item is selected, its sequence number is stored in the system field @MENU_CHOICE. The keyword is stored in the system field @MENU_KEYWORD. The value of @MENU_ CHOICE or @MENU_KEYWORD can be examined to determine which item has been selected.
The order of ITEM statements within the LAYOUT SCREEN definition is significant. The MENU statement/command processes the ITEM statements in the order in which they are defined, not in the order that they appear on the screen. If the selected item is the second ITEM statement in the LAYOUT SCREEN definition, the value of @MENU_CHOICE is 2.
/ITEM row column rendition text
row |
is an integer constant that specifies the row position where the menu item description begins in the menu. |
column |
is an integer constant that specifies the column position where the menu item text begins in the menu. |
rendition |
specifies the video attributes for the item text. More than one video attribute may be specified by separating the attributes with plus signs. |
|
The valid video attributes are:
|
text |
specifies the item description. This must be a quoted string. The length of the item text must be within the bounds of the menu and cannot exceed 131 characters. Extra characters are truncated. |
/ITEM 2 10 @NORMAL "Enter a new record"
/ITEM 6 10 @NORMAL "Exit the menu"
/ITEM 4 10 @NORMAL "Delete a record"This example shows three items that are defined for a menu. "Enter a new record" appears at row 2 and column 10, "Exit the menu" appears at row 6 and column 10 and "Delete a record" appears at row 4 and column 10. The rendition for all items is normal.
When "Delete a record" is chosen during the menu operation, @MENU_CHOICE has the value of 3 despite the fact that "Delete a record" appears second on the menu display (row 4). @MENU_KEYWORD will also contain the associated keyword.
NOTE: It is recommended that @MENU_KEYWORD be used instead of @MENU_CHOICE. If the LAYOUT SCREEN definition is changed during maintenance and a new item added or one deleted, the sequence number of the following items will change, which means that any affected Process Module (PM) or Command Module will also need to be changed. If @MENU_KEYWORD is used, a menu item can be added or deleted without changing an existing PM or CM. The ITEM statement is optional.