Use this field-level keyword to define a choice for a menu-bar field. A menu-bar choice represents a group of related actions that the application user can select. A group of actions appears in a pull-down menu when the user requests a menu-bar choice.
The format of the keyword is:
MNUBARCHC(choice-number pull-down-record choice-text [&return-field])
The choice-number parameter is required and specifies an identification number. The choice number is returned to the application to indicate which choice in the menu bar was selected. Valid values for the choice number are integers 1 to 99. Duplicate values within a single menu-bar field are not allowed.
The pull-down-record parameter is required and specifies the name of the pull-down record that is displayed when the user selects this choice. The record specified must exist within the file and must contain a PULLDOWN keyword.
The choice-text parameter is required and defines the text that appears in the menu bar for the choice. The parameter can be specified in one of two forms:
As a character string: 'Choice text '
As a program-to-system field: &field-name
The field-name specified must exist in the menu bar record and must be defined as a character field with usage P.
The choice text must fit on one line of the display for the smallest display size specified for the file. Since the text for the first menu-bar choice on a line begins at position 3 and a trailing blank is always inserted after the choice text, the maximum length of the choice text is 76 if the smallest display size for the file is 24 x 80 and 128 if the smallest display size for the file is 27 x 132.
When the choice text contained in the character string or the program-to-system field is displayed, trailing blanks in the text are truncated and 3 blank spaces are inserted between choices. However, the number of lines that the menu-bar field occupies on the display is determined by the sum of the lengths of the choice-text parameters, plus 3 blank spaces between each choice. The length of the choice-text is either the length of the character string, excluding trailing blanks, or the length of the program-to-system field. The maximum number of lines that a menu bar field may occupy is 12 lines (this includes the separator line).
Within the choice text, you can specify a mnemonic for the choice by using a greater than character (>) to indicate the mnemonic character. The character to the right of the > is the mnemonic. Examples:
To specify a > as a character in the text, you must specify it twice, just as you must specify the apostrophe character twice in order to get a single apostrophe character in the text.
The mnemonic character indicated must be a single-byte character and must not be a blank. Only one mnemonic is allowed in the choice text, and the same mnemonic character cannot be specified for more than one choice.
The return-field parameter is optional and specifies whether or not control is returned to the application because a menu bar choice was selected. This parameter specifies the name of a hidden field in the menu-bar record that contains the number of the choice selected when control is returned to the application. The hidden field is defined as a data type Y (numeric), the length of the field is two, and decimal positions are 0. The presence of a choice number in this field indicates that control has been returned to the application because a menu-bar choice was selected. The next operation of the application updates (if necessary) and writes the pull-down record associated with that choice; that is, the pull-down record specified on the MNUBARCHC keyword for the choice. When a choice number is returned in this field, zero is returned in the field that contains the choice number after pull-down input has been received. Likewise, when pull-down input has been received, zero is returned in this field, and the presence of a choice number in menu-bar field or the choice field in the application record indicates that the application should process the pull-down input.
The menu bar field contained in the MNUBARCHC keywords is defined as an input-capable field with data type Y (numeric). The length of the field is two and decimal positions 0. If the menu bar record is read, the number of the choice selected (if any) is returned in the menu-bar field. The menu-bar field must always be defined as starting in row 1, column 2.
When MNUBARCHC is specified on a field, the MNUBAR keyword is required at the record level.
Multiple MNUBARCHC keywords can be specified for one menu bar field. The number of MNUBARCHC keywords that can be specified is limited only by the lengths of the choice text parameters (excluding trailing blanks in character string choice-text) and the 12 line limit for a MNUBAR. All the choices defined for a menu bar field must fit on the screen, allowing for 3 spaces between each choice.
The following keywords can be specified on a field with the MNUBARCHC
keyword:
ALIAS CHCAVAIL CHCSLT |
INDTXT MNUBARSEP TEXT |
|
Option indicators are valid for this keyword.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.