MNUBARDSP (Menu-Bar Display) keyword for display files

Use this record-level keyword to display a menu bar. The MNUBARDSP keyword has two formats: one for records that contain the MNUBAR keyword and one for records that do not contain a MNUBAR keyword.

The format for MNUBARDSP when specified on a record that is not a menu bar record is:
MNUBARDSP(menu-bar-record &choice-field [&pull-down-input])
The format for MNUBARDSP when specified on a menu bar record is:
MNUBARDSP[(&pull-down-input)]

The menu-bar-record parameter specifies the menu-bar record that is to be displayed when this record is written. The menu-bar record must exist in the same file as the record you are defining.

The &choice-field parameter specifies the name of a hidden field, which on input contains the number of the choice (if any) selected from the menu bar. The field must exist in the record you are defining and it must be defined as numeric Y in position 35, usage H, length 2, and decimal positions 0.

The &pull-down-input parameter is optional and specifies the name of a hidden field that contains the input from the pull-down menu when the pull-down menu contains only a single-choice selection field. The field must exist in the record you are defining and it must be defined as a length 2, decimal positions 0, and zoned (S in position 35) field with usage H (hidden). On input, this field contains one of the following values:
Value
Meaning
0
No selection made.
n
Choice n in the pull-down menu was selected.
-1
Pull-down record contains something other than the one single-choice selection field. You must read the pull-down record to receive its contents.

Option indicators are valid for the MNUBARDSP keyword, and more than one MNUBARDSP keyword can be specified on the record if all are optioned. If more than one MNUBARDSP keyword is in effect when the record is written, the first one in effect is used.

Example 1

The following example shows how to specify the MNUBARDSP keyword on a record that is not a menu bar.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
     A
     A          R RECORD1
     A  01                                  MNUBARDSP(MENURCD &MNUCHOICE &INPUT);
     A            FIELD1        10A  B 10 12
     A            FIELD2         5S 0B 14 12
     A            MNUCHOICE      2Y 0H
     A            INPUT          2S 0H
     A          R MENURCD                   MNUBAR
     A            F1             2Y 0B  1  2
     A                                      MNUBARCHC(1 PULLFILE 'File')
     A                                      :
     A                                      :
     A

In this example, if option indicator 01 is on when record RECORD1 is written to the display, the system displays the menu bar in record MENURCD. When the menu bar is activated and the pull-down menu is selected, the number of the menu-bar choice is returned in field MNUCHOICE. If the pull-down menu selected contains one single-choice selection field, the choice made for that field is returned in field INPUT. Otherwise, field INPUT contains -1, indicating that the application must read the pull-down record to receive the pull-down input.

Example 2

The following example shows how to specify the MNUBARDSP keyword on a menu-bar record.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
     A          R MENURCD                   MNUBAR
     A  01                                  MNUBARDSP
     A            F1             2Y 0B  1  2
     A                                      MNUBARCHC(1 PULLFILE 'File')
     A                                      :
     A                                      :
     A

If option indicator 01 is on when record MENURCD is written to the display, the system displays the menu bar defined in MENURCD. If the user selects a pull-down menu from the menu bar, the number of the menu-bar choice selected is returned in F1 field.