SeeView Manual

SeeView Language Elements
HP NonStop SeeView Manual526355-004
5-36
SeeView Externals
SeeView Externals
The term external refers to any SeeView program, or script fragment, that can be
invoked from the External menu of the standard SeeShell.
The program in Example 5-16 provides an external script that you can use to declare a
command interpreter task and display a window on that task. You can specify the
location and size of the window.
A script contained in an EDIT file is an external script. You can add external scripts to
the standard SeeShell External menu by using the External menu item under the
SeeView Extras menu. When you add a file to the External menu, you invoke it by
selecting that menu item, as Figure 5-17 on page 5-37 shows.
When the program in Example 5-16 is invoked from the External menu:
?MENU Config stores the screen image data in a cache named Config.
?SECT Main positions the current screen buffer address beside the calling menu
(which is the External menu) and displays the Config window dialog box.
Example 5-16. Example of an External Script to Configure an Environment
?MENU Config
{-----------}
PROGRAM Filename[ ] :: (alphanum)
Command [ ]
WINDOW Page [ ] Location [ ] :: (n)
Width [ ] Height[ ] :: (n) (n)
Heading [ ]
*
?PROC GetConfig
{--------------}
LINE #menuline, #menucol;
VARIABLE #ci, #cmd, #pg, #loc, #width, #height, #hdr;
ACCEPT #ci, #cmd, #pg, #loc, #width, #height, #hdr;
EXECUTE "TASK " & #ci; { declare command interpreter
EXECUTE "WITH " & #ci; { get with command interpreter
IF #cmd<>"" THEN WRITE #taskid,#cmd;
IF #pg <>"" THEN PAGE #pg;
IF #loc<>"" THEN EXECUTE #loc;
IF #width="" THEN #width:=80;
IF #height=""THEN #height:=24;
IF #hdr="" THEN #hdr := #tasksymbol;
WINDOW #taskid CACHE LASTLINE
SIZE #width,#height NOCURSOR
HEAD #hdr;
?SECT Main
{---------}
BESIDE;
WINDOW Config MENU "CALL GetConfig" FIELDS (u)
CACHE FIRST UNTIL "*" SIZE 52;