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.
MNUBARDSP(menu-bar-record &choice-field [&pull-down-input])
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.
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.
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.
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.