SeeView Manual

SeeView Language Elements
HP NonStop SeeView Manual526355-004
5-5
Menus
The menu production mechanism forms the basis for a variety of techniques to create
menus that are described in this section. When you invoke a menu production by using
the Return key, the following information about the action is globally available:
Location of the invoked menu: #MENULINE, #MENUCOL
Size of the invoked menu: #MENUWIDTH, #MENUHEIGHT
Location of the cursor: #FKEYLINE, #FKEYCOL
Text to the left of the production: #MENUTEXT
Text token pointed to by the cursor: #MENUTOKEN
Text input to a prompt production: #MENUINPUT
Ordinal record position of text in cache:
# MENUCACHELINE
#MENUCACHELINEPTR
Example 5-3 shows a simple SeeView program that displays a list of device types in a
menu. The directives in this program function as follows:
?MENU DevTypes declares a cache to store the names of device types and their
associated SeeView language productions.
?PROC Listdev displays a list of selected device types in a window beside the
caller’s menu by using the PUP LISTDEV command.
?SECT Main displays the initial device type menu. Sections are executed
immediately when a SeeView program is invoked.
Example 5-3. SeeView Program With ?MENU, ?PROC, and ?SECTION Directives
?MENU DevTypes { Declare cache "DevTypes"
{-------------}
Disk <== CALL Listdev ("disk" ) { CALL ?PROC Listdev
Tape <== CALL Listdev ("tape" ) { #DeviceType = "tape"
Term <== CALL Listdev (#menutext) { #DeviceType = "Term"
Printer <== CALL Listdev (#menutext) { #DeviceType = "Printer"
Expand <== CALL Listdev ("type 63") { #DeviceType = "type 63"
*
?PROC Listdev ( #DeviceType ) { Declare procedure "Listdev"
{---------------------------}
PARM #DeviceType; { #DeviceType is callers parameter.
TASK pup; { Declare PUP process taskid.
BESIDE; { Position beside invoked menu.
WINDOW pup, "listdev " & #DeviceType; { Window on Pup output from Listdev.
?SECT Main { Declare main sect to do setup
{---------}
PAGE 2; { On terminal page number 2.
WINDOW DevTypes MENU { Build menu window on DevTypes
CACHE /disk/ UNTIL /*/ { cache from /disk/ until /*/
SIZE 13 HEADING ""; { with menu width of 13 characters.