SeeView Manual

SeeView Language Elements
HP NonStop SeeView Manual526355-004
5-10
Menus
In the program in Example 5-6, the directives function as follows:
?MENU MyMenus declares the name of a cache of text used for the menus. Lines
containing prompt productions (<==?) are formatted automatically for input
between the left and right brackets. If you put a variable name within these
brackets, its value appears in the input field.
?PROC PopUpPrompt displays the appropriate prompt. For example, when you
select the menu option Backup, the contents of variable #BackupOptions appears
in a highlighted input field below the calling menu. (See Figure 5-3 on page 5-11.)
You can edit this input field directly. When you press the Return key from this field,
the procedure ?PROC Backup is called.
?PROC Backup runs the BACKUP program using the options input to the prompt
production. The results appear in a window below the prompt. This procedure sets
the value of the global variable #BackupOptions so that the most recent prompt
input text for Backup is retained.
?SECT Main displays the initial Backup/Restore menu.
Example 5-6. Example of Prompts With Prompt Productions
?MENU MyMenus { Declare menu cache "MyMenus"
{------------}
Backup <== CALL PopUpPrompt( "BackupOptions" );
Restore <== CALL PopUpPrompt( "RestoreOptions");
*
[#BackupOptions ] <==? CALL Backup (#MENUINPUT)
[#RestoreOptions ] <==? CALL Restore(#MENUINPUT)
?PROC PopUpPrompt ( #target ) { This procedure displays a pop-up prompt
{---------------------------} { from the MyMenus menu cache.
PARM #target; { #target is text target in cache.
BELOW; CLEARW; { Position and clear below calling menu.
WINDOW MyMenus MENU { When Window is built the prompt production
HEAD "" { automatically reformats [#BackupOptions ]
CACHE #target { to input field with #BackupOptions value.
FOR 1 SIZE 50 GLASS;
?PROC Backup ( #options ) { This procedure does a Backup
{-----------------------} { The #menuinput is text input to the
PARM #options; { prompt production when Return is pressed.
TASK backup STARTUP #options; { Run BACKUP program with STARTUP options.
BELOW; { Position Backup window below prompt.
WINDOW backup EOFSEEK; { Window on Backup with end of file seeking.
#BackupOptions := #options; { Save input in variable for next time.
?PROC Restore ( #options )
{------------------------}
{ .. see backup
?SECT Main
{---------}
VAR #BackupOptions := "$TAPE, " & #VOLSUB & ".*, LISTALL"
,#RestoreOptions := "$TAPE, " & #VOLSUB & ".*, LISTALL"
;
PAGE 2;
WINDOW MyMenus MENU CACHE FIRST UNTIL /*/ SIZE 13 HEAD "";