Professional Documents
Culture Documents
Abstract
HPE NonStop SeeView is a Script Execution Environment and Virtual Interface to
Extensible Windows (SeeView) for command language standard (CLS) programs.
SeeView provides block-mode shell facilities for CLS programs that execute on HPE
NonStop servers.
SeeView also provides command-interpreter shell facilities for CLS programs that
execute on HPE NonStop servers.
SeeView also provides server-mode shell facilities for NonStop host and web client
interfaces to interactive CLS programs that execute on HPE NonStop servers.
Product Version
Applies to: T6965D40^AAI, T6965H01^AAJ, T6965L01 or later for G-, H-, J-, L-series respectively.
Document History
Part Number Product Version Published
135082 D40AAE January 1998
526355-001 D40AAF September 2003
526355-002 D40AAG April 2004
526355-003 D40AAH April 2005
526355-004 D40AAH and H01 or later June 2005
526355-005 D40AAI or later and H01AAJ or later February 2006
Audience
This manual addresses two audiences. Users who want to use the standard SeeShell
only should read Sections 1 through 3. Programmers who want to write SeeView
programs or learn about the SeeView product in greater detail should read the entire
manual.
This manual makes the following assumptions:
Users who want to use the standard SeeShell are familiar with the HPE NonStop
operating system and its utilities.
Programmers who want to write SeeView programs know the basic principles of
structured-language programming.
Related Manuals
This manual assumes you are somewhat familiar with the HPE NonStop operating
system (OS), utilities, subsystems, and command interpreters including TACL,
SPOOLCOM, FUP, ASAP, SCF, and so on. These documents provide information
about related HPE products that depend on the SeeView kernel object code:
SeeView Server Gateway (SSG) Manual
Web ViewPoint User’s Guide
OSM guided procedures
ASAP Server Manual
ASAP Client Manual
Data Definition Language (DDL) Reference Manual
Notation Conventions
Hypertext Links
Blue underline is used to indicate a hypertext link within text. By clicking a passage of
text with a blue underline, you are taken to the location described. For example:
This requirement is described under Backup DAM Volumes and Physical Disk
Drives on page 3-2.
UPPERCASE LETTERS
Uppercase letters indicate keywords and reserved words. Type these items exactly as
shown. Items not enclosed in brackets are required. For example:
MAXATTACH
Lowercase italic letters indicate variable items that you supply. Items not enclosed in
brackets are required. For example:
file-name
computer type
Computer type letters within text indicate C and Open System Services (OSS)
keywords and reserved words. Type these items exactly as shown. Items not enclosed
in brackets are required. For example:
myfile.c
Italic computer type letters within text indicate C and Open System Services
(OSS) variable items that you supply. Items not enclosed in brackets are required. For
example:
pathname
[ ] Brackets
{ } Braces
A group of items enclosed in braces is a list from which you are required to choose one
item. The items in the list can be arranged either vertically, with aligned braces on
each side of the list, or horizontally, enclosed in a pair of braces and separated by
vertical lines. For example:
LISTOPENS PROCESS { $appl-mgr-name }
{ $process-name }
ALLOWSU { ON | OFF }
| Vertical Line
… Ellipsis
An ellipsis immediately following a pair of brackets or braces indicates that you can
repeat the enclosed sequence of syntax items any number of times. For example:
M address [ , new-value ]…
[ - ] {0|1|2|3|4|5|6|7|8|9}…
An ellipsis immediately following a single syntax item indicates that you can repeat that
syntax item any number of times. For example:
"s-char…"
Punctuation
Parentheses, commas, semicolons, and other symbols not previously described must
be typed as shown. For example:
error := NEXTFILENAME ( file-name ) ;
LISTOPENS SU $process-name.#su-name
Quotation marks around a symbol such as a bracket or brace indicate the symbol is a
required character that you must type as shown. For example:
Item Spacing
Spaces shown between items are required unless one of the items is a punctuation
symbol such as a parenthesis or a comma. For example:
CALL STEPMOM ( process-id ) ;
If there is no space between two items, spaces are not permitted. In this example, no
spaces are permitted between the period and any other items:
$process-name.#su-name
Line Spacing
If the syntax of a command is too long to fit on a single line, each continuation line is
indented three spaces and is separated from the preceding line by a blank line. This
spacing distinguishes items in a continuation line from items in a vertical list of
selections. For example:
ALTER [ / OUT file-spec / ] LINE
[ , attribute-spec ]…
!i and !o
In procedure calls, the !i notation follows an input parameter (one that passes data to
the called procedure); the !o notation follows an output parameter (one that returns
data to the calling program). For example:
CALL CHECKRESIZESEGMENT ( segment-id !i
, error ) ; !o
!i,o
In procedure calls, the !i,o notation follows an input/output parameter (one that both
passes data to the called procedure and returns data to the calling program). For
example:
error := COMPRESSEDIT ( filenum ) ; !i,o
!i:i
In procedure calls, the !i:i notation follows an input string parameter that has a
corresponding parameter specifying the length of the string in bytes. For example:
!o:i
In procedure calls, the !o:i notation follows an output buffer parameter that has a
corresponding input parameter specifying the maximum length of the output buffer in
bytes. For example:
error := FILE_GETINFO_ ( filenum !i
, [ filename:maxlen ] ) ; !o:i
Bold Text
Bold text in an example indicates user input typed at the terminal. For example:
ENTER RUN CODE
?123
CODE RECEIVED: 123.00
The user must press the Return key after typing the input.
Nonitalic text
Nonitalic letters, numbers, and punctuation indicate text that is displayed or returned
exactly as shown. For example:
Backup Up.
Lowercase italic letters indicate variable items whose values are displayed or returned.
For example:
p-register
process-name
[ ] Brackets
Brackets enclose items that are sometimes, but not always, displayed. For example:
Event number = number [ Subject = first-subject-value ]
{ } Braces
A group of items enclosed in braces is a list of all possible items that can be displayed,
of which one is actually displayed. The items in the list can be arranged either
vertically, with aligned braces on each side of the list, or horizontally, enclosed in a pair
of braces and separated by vertical lines. For example:
obj-type obj-name state changed to state, caused by
{ Object | Operator | Service }
process-name State changed from old-objstate to objstate
{ Operator Request. }
{ Unknown. }
| Vertical Line
% Percent Sign
A percent sign precedes a number that is not in decimal notation. The % notation
precedes an octal number. The %B notation precedes a binary number. The
%H notation precedes a hexadecimal number. For example:
%005400
%B101111
%H2F
P=%p-register E=%e-register
Uppercase letters indicate names from definition files. Type these names exactly as
shown. For example:
ZCOM-TKN-SUBJ-SERV
lowercase letters
Words in lowercase letters are words that are part of the notation, including Data
Definition Language (DDL) keywords. For example:
token-type
!r
The !r notation following a token or field name indicates that the token or field is
required. For example:
ZCOM-TKN-OBJNAME token-type ZSPI-TYP-STRING. !r
!o
The !o notation following a token or field name indicates that the token or field is
optional. For example:
ZSPI-TKN-MANAGER token-type ZSPI-TYP-FNAME32. !o
To exit without saving your editing changes, type E or ESCAPE on the sill of the
edit-mode window.
Then press SF16 twice to stop the SeeView program.
SeeView Overview
SeeView provides users of standard HPE terminals (or terminal emulators running on
a PC, Macintosh, or other workstation) with a windowed terminal display similar to
those on many PC or workstation-based products.
By using SeeView, you can display several windows on the workstation at the same
time, each one displaying the output from a different program. For example, you might
have three windows on the screen, one assigned to TACL, one to Peruse, and one to
an editor. After making changes to a program in the editor window, you could compile
the program by entering commands at the TACL window and then look at the listing
from the window assigned to Peruse. With SeeView, you can have several windows
displaying output from the same program (such as two windows, one displaying the
beginning of a file, the other the end). It is also possible to have several programs
share the same window.
SeeView gives you these key features:
Menus
The SeeView product gives you the ability to use menus to perform actions. You can
use a menu to provide users with one or more choices and perform a set of commands
when an item is selected from the menu. You can associate a complex set of
commands with a simple menu entry, enabling you to create a menu-driven
environment for both new and experienced users.
Once you learn a few simple function keys, SeeView becomes an easy-to-use
interface for many of your daily tasks. SeeView provides an interactive, easy-to-
customize environment for many different uses. System managers, operators,
developers, analysts, and others can use it daily as a command interpreter. The
presentation capabilities of the SeeView product allow it to function in a desktop or
workbench environment, making it a powerful productivity tool.
Scripts
The SeeView product has a programmatic interface that allows users to write SeeView
programs (called scripts). You can write scripts to control window placement on the
screen, assign each window to a process, decide what text is sent to a process,
determine how the output from a process is displayed, and perform many other
functions. You can use these scripts to customize SeeView when first started, or
execute the scripts from a SeeView session that has already been started. For more
information on writing your own scripts, see Section 5: SeeView Language Elements
through Section 9: SeeView Statements and Script Symbols.
Features
SeeView provides:
Equipment independence: SeeView does not require any special equipment. It
runs equally well on HPE 6530 terminals and PC, UNIX, and Macintosh
workstations using HPE and third-party terminal emulation software.
Quick Access: By enabling you to run many programs concurrently, the SeeView
product drastically reduces the overhead caused by repeated process creation and
deletion. Rather than stopping and starting a process every time you need it, you
start it once in the SeeView program and keep it running in one of your windows.
Accessing that process is then as simple as moving the cursor to a window
assigned to that process, making a context switch quick and efficient.
Text Scrolling: You can display the output of each process in one or more
windows. The SeeView program allows you to scroll through the text displayed in a
window; for example, to review old output from a process. This effectively gives
each process its own workstation, while allowing you to select which part of the
output from a process is to be displayed at any time. You can also scroll text from
side-to-side to display process output that is wider than the window.
Context Switch: By making use of the multiple pages of memory internal to the
workstation, the SeeView product allows you to keep windows on terminal pages
that are not displayed. By keeping these windows in the actual workstation, the
program lets you switch back to one of these windows quickly. Press a function
key to display the desired window. This allows context switches to occur in a few
milliseconds and significantly reduces the number of input-output (I/O) bytes
required to redisplay a window (up to 500 times).
I/O Savings: When multiple windows appear on the same page, the SeeView
program updates all windows on the screen in a single I/O. By blocking multiple
line-at-a-time I/Os into a single I/O, the program greatly reduces the number of I/O
operations. Compared to a process performing line-at-a-time I/O, the SeeView
program can reduce I/O messages up to 20 times, a significant savings when
applied to functions that can produce hundreds of lines of output, such as SCF
LISTDEV or TACL PPD commands.
Command History: SeeView keeps a command history for every process running
in the SeeView environment. This allows you to recall commands for reexecution
or simply review commands entered for a process. You can modify commands
before reexecution, simplifying the rekeying of commands that are similar. Using
the command history allows you to easily correct mistakes.
Block Mode: Although the display device or workstation is operating in block
mode while the SeeView program is using it, the processes whose output appears
in SeeView windows must be conversational processes using the common
SeeView Terms
The following terms describe SeeView components.
Task
A task refers to a process that the SeeView program is communicating with. Tasks can
have their output displayed in a window (or several windows). When you create a task
(either from a menu selection or through a SeeView command), SeeView builds a
Task Control Block (TCB) to keep track of attributes specific to the task. SeeView has
a limit of 4096 TCBs, which means you can run up to 4096 processes in your SeeView
environment. SeeView stores the output in a cache.
Window
A window displays the output of a task (process), or equivalently, the contents of a
task‟s cache. SeeView allows you to have a total of 128 windows in your environment.
Because you can have up to 4096 tasks, some tasks are not assigned to a window.
You can assign windows to the task whose output you want to display. You can have
the output from several tasks displayed in the same window, you can have several
windows displaying output from the same task (perhaps at different locations in the
cache associated with the task), and you can copy text displayed in any window for
use elsewhere in your SeeView environment (for example, as input to another task).
Sill
You generally cannot modify the display area of a window, but you can enter
commands at the bottom of a window. This area is called the sill. When you press
Cache
When you send a command to a task by entering it on the sill of a window assigned to
the task and pressing Return, the SeeView program sends the command to the
process and waits for a response. The response to your command is then displayed in
the current window and also stored in a cache, managed by the SeeView program.
Caches are similar to large arrays that can be accessed by read and write operations
via indexing. They are linearly linked, sequential lists of strings containing menu items,
data, or commands.
By storing output in cache memory, the SeeView program enables you to scroll back to
look at old output. Because each task generally has its own cache, you have a record
of your work with each task. Two tasks can share a cache when one task starts
another task. For example, when you start a PERUSE process from a TACL process,
these tasks are called peer tasks.
When the SeeView program is first started, it allocates memory to be used for all the
caches it will create when tasks are started. A task is assigned a portion of this total
cache pool the first time it is started, and the amount allocated to a task cannot be
changed once assigned. At some point, the cache for a task will fill up. When the
cache fills up, the oldest lines in the cache for the task are lost, and new lines reuse
their space. In this way, a cache always contains the most recent output for that task.
In many ways, the SeeView program acts as a cache manager. When the SeeView
program receives output from a task, that text is stored in a cache. The program keeps
track of which tasks are associated with which cache and stores output in the
appropriate location. A window displays the output stored in a cache. The sill of a
window provides a place to enter new commands for the process (task) associated
with the cache displayed in the current window.
Scroll
You can display any text that is in a task‟s cache in a window (or several windows).
Once a window is created and assigned to a task, you can scroll through the text in the
window to display the area of interest by pressing function keys. You can scroll
vertically or horizontally within a window. Scrolling horizontally displays lines of text
that are too wide for the current window size.
Scripts
SeeView provides a command language for customizing environments and defining
menu actions in command files called scripts. Scripts are EDIT files containing
statements in the SeeView script language that are executed in response to some
action on your part (such as making a menu selection).
External Scripts
The standard shell also allows you to access external scripts that are not part of the
environment set up by the shell. You can access them through a shell menu or by
explicit commands.
Terminal Pages
Workstation models vary in the amounts of internal memory. SeeView bases the
number of terminal pages depending on how much memory is available. On the 6530
series terminals, SeeView uses eight pages. On the 6526 series, the program uses 13.
With some emulators, you can set the number of terminal pages.
Help Page
SeeView displays its Help page without disturbing any windows you set up on other
pages. The program also uses the Help page for several other purposes, such as
displaying status information and developing scripts.
User Pages
Available pages within a workstation are called user pages. You can display the
windows you need. A 6530 terminal has 7 user pages, and a 6526 terminal has 12
user pages.
SeeView Help
The SeeView product comes with extensive help facilities. For example, to get general
help, type HELP NEW USER from any window sill and press Shift-Return or Return
from the sill of a free window. The first page of help displayed after you type HELP
NEW USER at a window sill:
For more specific information on a SeeView statement, type HELP, the name of the
specific statement, and press Return; for example, HELP ACCEPT. For help on a
function key, type HELP and the function key name; for example, HELP F1.
Each of the first three menus, System Devices, System Utility, and SeeView Extras, is
covered in a separate subsection. The last three items, Network SeeNet, Site SeeLocl,
and User SeeCstm, are discussed in the subsection Custom Shells. These last three
customized menus will appear differently on your system.
When you select an item on the Devtypes menu, you get system information about that
device type. Table 2-1 briefly outlines the commands available from the System
Devices menu. This subsection gives examples of some of the menu items on the
System Devices menu.
If the list is too long to fit on the page, press NEXT PAGE (with the cursor in the
window listing the drives) to see additional devices.
The default action for disk devices on the D-series and earlier NonStop operating
systems is to execute a PUP LISTFREE HISTOGRAM command, producing a list of
free space on the selected disk. (The heading reads “LISTFREE,H”.)
For the G-series and later, the default disk command is STATUS DISK. The SeeShell
automatically determines which version of the NonStop OS is present and performs
the correct command.
You can change these commands (or actions) according to the device you select.
When you select one of the listed commands, the device name menu reappears with
the new command at the top.
For example, when you select the command LISTCACHE, that command appears at
the top of the device name menu:
In the PUP window, you can scrolled left or right with the SF12 or SF13 function key to
display any text that does not fit in the window.
In the next example, if you select the disc $SYSTEM, the LISTFREE command
displays a DISK FREESPACE HISTOGRAM for the selected disc device in a window
labeled Peripheral Utility Program (PUP). In this case, the window label indicates that
the operation is performed using the system utility PUP.
To interact with the PUP window, move the cursor to the sill of that window, type one
or more PUP commands, and press Return.
The printer device name menu does not contain the Command? option. The
DEV,STATUS command at the top of the menu is the only command you can invoke
for any of the printer devices listed.
If you select a printer device name such as $LP, the SeeView program displays the
spooler status for that device in a SPOOLCOM window:
The SPOOLCOM window also has a sill. To interact directly with this window, place
the cursor on the sill, enter a command, and press Return. For example, enter the
following command to get information on the collector‟s name and status:
collect $s,status
For the items on the communications device types menu, SeeShell works in a manner
similar to that described under Obtaining Disk Information on page 3333.
Select an item in the System Utility menu, to use system utilities, such as Backup and
Restore, as well as file functions and a TACL window. Table 2-2 outlines the
commands available from the System Utility menu.
If you select a file name such as DOC2 on the Fileinfo menu, SeeShell displays these
information windows and additional menus:
The View window displays the first few lines of the selected EDIT file.
The Selected File window displays the fully qualified file name of the file selected.
Select an editor on the Editor? menu to use that editor on the selected file.
If you select one of the Seedit editors and that editor already has a window on another
page of the terminal, the contents of the selected file appears in that window. (See
Configuring Tasks on page 5555.) Otherwise, the file appears on the current terminal
page.
For example, if you select Seedit on the Editor? menu, SeeShell loads a copy of the
selected file, DOC2, into the Seedit window and automatically enables Edit mode:
The File(s) option works as a toggle to alternate between single-file and multiple-file
mode.
With multiple-file mode enabled, you can select any number of file names in the
Fileinfo menu. In this example, the files DOC2, DOCUMENT, and FRONT are
The View window displays the contents of the most recently selected file if that file is
an EDIT file. If the file is not an EDIT file, the View window displays additional file
information for the file.
As in single-file mode, the three options menus below the Selected Files window
provide options that you can perform on all the files displayed in the Selected Files
window.
Selecting any of the items on the options menus performs the corresponding operation
on the selected files.
For example, if the DUP option is selected, SeeView displays a prompt:
To fileset.* [ ,options ]
If necessary, you can edit the text in the prompt directly. The Backup command is
executed when you press Return.
The SeeView program displays a split screen with Backup and TACL windows:
You can use this split screen to help manage the back-up operation. If labeled tape
support is enabled, you can use the lower TACL window to run TAPECOM, to check
for mounts, and to accept the tape mount request.
Once the tape is mounted, the BACKUP window displays the ongoing status of the
back-up operation.
Selecting Pathway from the System Utility menu allows you to perform various
operations on the objects in a Pathway system.
When you respond to the PATHMON prompt, by entering the process name $TRPM
for example, SeeView displays an options menu labeled with the specified PATHMON
name, as shown below. This menu lists operations that can be performed on the
Pathway components associated with the specified PATHMON process $TRPM.
If you select PM from the Pathway options menu, the SeeView program displays the
Pathcom window. This window shows the output from a STATUS PATHMON
command:
If you select Trm (terminal) from the Pathway options menu, SeeShell displays a list of
Pathway terminal IDs in the STATUS,DETAIL window.
If you select the first item from the STATUS,DETAIL menu, SeeView displays the
output from a PATHCOM STATUS DETAIL command in a window below the terminal
ID menu:
To change the command to be executed for the terminals listed, select Command?
from the terminal ID menu window. SeeView displays a menu of available commands:
The heading at the top of the spooler job window indicates the current command,
JOB,STATUS, for any of the spooler jobs listed. To change the current command,
select Command? in the spooler jobs window.
If you select job 42, the SeeView program displays information about that job in a
Spoolcom window.:
Selecting one of the listed commands, such as JOB,LIST FIRST, redisplays the
spooler job window with a new heading that reflects the newly selected command.
Once you change the command, you can select the spooler job for which the new
command is to be performed. If you select job 42, SeeView displays the contents of
the job file in a window labeled PERUSE:
The Peruse window has a sill, so you place the cursor on the sill, type the command
you want executed, and press Return.
The following pages discuss the Color, Config, and External items on the SeeView
Extras menu.
The SeeView Extras menu provides miscellaneous SeeView features. See Table 2-3.
If you select Color, SeeView displays the Color menu shown in the next illustration.
The Color menu lists the options that you can use to alter the color or video
characteristics of SeeView windows and menus.
ColorShow displays a menu list of video attribute combinations available for a 6500-
series terminal, as shown in the next illustration.
Video ON causes 6500-series video attributes, rather than alternate graphic
characters, to be used in framing all SeeView windows and menus. This option
reduces by about 50 percent the amount of I/O needed to draw a window.
When this menu appears on a PC running PCT, you can change the background and
foreground colors for a given video attribute combination by selecting the
corresponding line on the menu. For example, selecting Line 1 Video Normal to display
a menu listing a number of colors.
The menu that appears when you select a line on the ColorMenu has a heading that
indicates the line number to be reconfigured.
To change the background color for the specified line, select the new color on the
second menu. To change the foreground color, you move the cursor so that it overlaps
any letter of the name of the desired color and then press Return.
In this example, the colors for Line 1 are changed to white background and black
foreground.
Configuring Tasks
Select Config from the SeeView Extras menu to declare user programs (called tasks)
and create windows on these programs.
If you select the Config item, the SeeView program displays a task configuration menu,
as shown in the next illustration.
Use the task configuration menu to declare user programs (called tasks) and to define
the location of windows for these programs.
Editing a File
When a Seedit GET command is executed, the contents of the specified file appear in
the current window. For enable edit mode for that window, press the Insert-Line key or
F5.
When you enable edit mode for a window, an advisory message appears in the
heading of the window and on line 25.
Once you enable edit mode for a window, you can edit the file directly by using the
function keys described on the Help Page. (Press F14 to display the Help Page. (For
more information on the Seedit utility and edit mode, see Section 4: Seedit Utility.)
When you finish editing the file, you can save or abandon the changes by entering
SAVE or ESCAPE, respectively, from the sill of the window. You can abbreviate SAVE
as S and ESCAPE as E.
The following example shows the window containing the file $THIRD.MM.DISCS ready
for editing. The heading at the top of the window changed from SEEDIT1 to the name
of the file ($THIRD.MM.DISCS) and the words in SEEDIT1. Also, a double line
appears at the top of the window.
If you select External, the SeeView program displays the External menu, shown in the
next illustration.
If you select Command? from the External menu, the SeeView program displays a
prompt next to the External menu:
Custom Shells
The standard SeeShell distributed with SeeView is organized so that the first three
items on the SeeShell main menu provide features or functions that are useful to a
large number of technical users.
The next three menus, Network SeeNet, Site SeeLocl, and User SeeCstm are
examples of menus that you or your system manager might want to provide for your
system. The first, Network SeeNet, provides a menu of HPE network performance
information. Beginning with the C30.09 RVU, the SeeNet script is not part of SeeView,
but is distributed as part of the Network Statistics Extended (NSX) product. The
SeeNet script provides access to various graphic reports generated by NSX. If your
site is not on a network or does not use NSX, this menu can be replaced with one
providing functions more specific to your system.
You can customize your environments with three separate, locally maintained SeeView
files named SEENET, SEELOCL, and SEECSTM. This arrangement allows the rules
that define the SeeView environment to be contained in the SEESHELL, SEELOCL,
SEENET, and SEECSTM files and in any external files that they referenced. None of
these rules reside in the SeeView program object file.
Follow these guidelines for organizing the SeeView custom shell files referenced by
the standard SeeShell.
SEELOCL
The Site SeeLocl menu provides an example that your site can customize for its own
use. Your local site or system management should maintain the SEELOCL file. As
provided by HPE, the Site SeeLocl menu provides an interface to an electronic mail
system (PSMAIL) and access to a number of other common utility functions.
Follow these guidelines:
SEELOCL is meant to provide common local site functions.
The SeeView program searches for the SEELOCL file on the SeeView object file
subvolume.
The contents of the SEELOCL file in the SeeView installation subvolume are an
example only.
SEECSTM
This menu provides a place for you to put your own personal SeeView functions. It is
easy to find utilities or functions you access frequently, such as access to a calendar or
phone list. Unlike the SEESHELL, SEENET, and SEELOCL files, the script file for this
menu should be located on the current volume and subvolume in effect when you start
the SeeView program.
Follow these guidelines:
Users can create their own SEECSTM files.
SeeView searches for SEECSTM on the currently invoked default subvolume.
(For more information on this item, see the ALTER INVOKEVOL statement and
the #VOLSUBINVOKE intrinsic.)
The contents of the SEECSTM file in the SeeView installation subvolume are an
example only.
NAME [pid]
specifies the process name of the SeeView program.
The SeeView program must be named.
IN file
specifies an alternate SeeView shell input file.
OUT file
specifies the terminal that the SeeView program will open.
option
specifies any standard TACL run option. For a description of the standard TACL
run options, see the TACL Reference Manual.
statement
specifies one or more SeeView statements described in Section 9: SeeView
Statements and Script Symbols.
To save your editing, position the cursor on the sill of the edit-mode window, type
S or SAVE, and press Return. The changes are then saved, replacing the original
file.
To exit the SeeView program without saving your editing, type E or ESCAPE on
the sill of the edit-mode window and press Return.
For a complete description of this display, see HELP STATUS. For each task,
SeeView displays the CPU, PIN, process name, and object file. The CachePg column
shows how many pages of cache are used and allocated for the task, and Timeout
shows how many seconds SeeView will wait for output from the task while processing
a script.
vst3-66.vsd
Free Windows
The three types of windows in the SeeView program are free, assigned, and menu.
Free windows have not been assigned to a user task or to a menu text cache. When a
window is free, any commands entered on the sill of that window are commands to the
SeeView language interpreter. Free windows do not have a heading.
Many SeeView statements entered from a free window result in data being displayed
in (or cleared from) that window. For example, CLEAR clears window area, STATUS
displays user task status, ALTER displays current option settings, and HELP displays
specified help.
It is sometimes useful to use the Help page as a place to enter these statements so
that you can later reference (for example, HELP for a statement that is being used or
Assigned Windows
A window with a heading is an assigned window. When a window is assigned to a
task, you can communicate directly with the task by placing one or more statements on
the sill of the window and pressing Return. Any messages displayed in the window
during such communication are saved in a message cache associated with the user
task.
To assign a free window enter OPEN task on the sill of the free window and press
Return.
To reassign an assigned window, enter OPEN task on the sill of the assigned window
and press Shift-Return.
Menu Windows
A window with a heavy- or double-line frame is a menu window. Each line of text in a
menu window, even if it consists of a single character, represents a user-defined
function that you can invoke by moving the cursor to the corresponding line and
pressing Return.
A line of text in a menu cache is said to be a menu production if that line contains a
production symbol (<==). In a menu production, the text to the right of the production
symbol is interpreted as SeeView language statements. The text to the left of the
production symbol is the text that actually appears in the menu window.
Menu windows can also have a default production associated with them. When a
menu has a default production defined for it, this production is invoked if a line of text
in the menu does not contain a production symbol.
Vst301
To interact with a window, enter commands on the sill. Move the cursor to the sill,
typing one or more commands, and press Return. When you press Return, the text
from the beginning of the line up to the cursor position is entered.
You can use the left and right arrow keys to move the cursor along the sill. You can
also use the following keys to edit any text on the sill:
CharIns Inserts a space to the left of the character at the cursor
position.
CharDel Deletes the character at the cursor position.
Ctrl-Return Moves the cursor to the end of the text on the sill.
EOFSEEK
You can have the SeeView program automatically scroll ahead. You can enable this
feature, called automatic end-of-file seek, on a window-by-window basis. To enable
and disable it, press the Shift-Del Line function key. (This key may be difficult to find on
some emulators. It is equivalent to Ctrl-Del with PCT.) Once you turn on end-of-file
seek, SeeView displays a window of text, pauses for a short period, automatically
displays the next lines in cache appears, and repeats this behavior until the last line in
cache is displayed. To disable Eofseek at any time, press Shift-Del Line again.
Responding to Prompts
When you select certain menu items in SeeShell, a prompt appears, on the screen.
When a prompt appears, it can include a default command. For example, this
illustration shows a prompt with a default command for a tape backup operation:
SeeView allows you to put different windows on different terminal pages. Use F1, F2,
SF1, or SF2 to select which page is displayed. When you press one of these function
keys, SeeView displays a message on line 25 of the terminal to tell you which page is
now displayed.
F1 displays the previous user page. When page one is displayed, F1 takes you to
the last user page.
F2 displays the next user page. From the last page, F2 displays page one.
SF1 always displays page one.
SF2 displays the last (highest numbered) user page with a window on it.
Message Caches
Free windows share a common message cache. You can use any free window to
display free window messages. All significant messages displayed on line 25 of the
terminal are also stored in the free window message cache.
To redisplay prior SeeView event messages in a free window at any time, use the
Next/Prev Page keys on the right side of the keyboard. The Help Page is often useful
for this purpose.
Assigned and menu windows display messages or text in the cache associated with
the user taskid that they are assigned to.
Return Key
Use the Return key to communicate with the entity associated with a given window.
Typing text on the sill of a window and pressing the Return key sends the text up to the
cursor position of the entity associated with the window. The effect of the Return key
operation depends on the type of window.
For a menu window (identified by a heavy- or double-line frame), the menu production
statements associated with the line designated by the cursor are invoked.
For a free window (and not a menu), the text is interpreted by the SeeView interpreter,
and the result appears in the window.
If the window is assigned (and not a menu), the text is sent to the user task associated
with the window, and the task‟s response is displayed in the window. To send text
entered on the sill of an assigned window to the SeeView interpreter rather than to the
task associated with the window, press Shift-Return. The OPEN statement is often
used in this manner. Thus, a window assigned to FUP can be reassigned to TACL
simply by entering this command on the sill of the window and pressing Shift-Return:
Break Key
The Break key terminates the current SeeView activity. Most commonly, the SeeView
program is waiting for a response from a task that is taking a long time to respond. (For
example, you might have used your TACL task to start a TGAL on a long text file.)
Press Break while SeeView is waiting for a task to respond to a command, SeeView
stops waiting for the response and allows you to perform other activities in your
SeeView environment (such as entering a command in another task's window).
If you press Break while SeeView is executing a script (which can happen because of
a menu selection you made), SeeView stops processing the statements in the script.
If the current activity is the processing of SeeView statements, the Break key halts the
SeeView interpreter and returns control of the keyboard to you.
Configured Timeouts
If the response from a user task exceeds the configured user-task timeout value, a
response timeout occurs, and full control of the keyboard returns to you.
Normally, when you press Return, the keyboard is unlocked immediately so that you
can type ahead while a blinking message on line 25 indicates that SeeView has
initiated your task request. At this point, you can do one of:
Command Description
CONNECT Moves a SeeView process from one terminal to another
FILES Displays a list of files in the specified subvolume
Loads an EDIT file into the current window
GET
HELP Displays help for a Seedit command
INFO Displays file information for the specified file or fileset
MONITOR Monitors a generic log file
MSG Sends a text message to another SeeView user
OBEY Obeys the specified file
PURGE Purges the specified file
RUN Executes the specified program
SEND Sends command to specific SeeView processes
SET Sets Seedit options
SUBVOLS Displays a list of subvolumes
Key Function
F3/F4 Scroll up/down one third of window height
F5/F6 Insert/Delete line at cursor or block if shifted
F7/F8 Retrieve/Copy line at cursor or block if shifted
F9/F10 Break/Join line at cursor
F12 Find text backward/forward on sill [+|-] / text /
F15/16 Word Tab back/forward from current location
PREV-PAGE Previous page of window text (first if shifted)
NEXT-PAGE Next page of window text (last if shifted)
ROLL-UP/DN Roll up/down scroll one line of window text
ROLL-UP/DN Roll up/down shifted scroll one third of window text
The edit-mode function keys are similar to those provided by the HPE EDIT VS virtual
screen editor. Use the VS editor function key template as a guide to all SeeView
function keys. Appendix B: SeeView Function Key Reference contains a detailed
description of each SeeView function key.
Note. Unlike other HPE editors, Seedit edits a copy of the original file, not the file itself.
Saving a File
Once editing is completed, to save changes, position the cursor on the sill of the edit-
mode window, type S or SAVE, and press Return. The changes are then saved,
replacing the original file.
Note. Typing E or ESCAPE on the sill of the edit-mode window provides the option of
terminating edit mode without saving any of the changes. Reenabling edit mode permits
subsequent saving of the file.
During edit mode, the only commands accepted on the sill of a window are the SAVE
or ESCAPE statements. Once edit mode is disabled through either of these
statements, you can use any of the Seedit commands.
Note. SAVE is a SeeView statement, not a Seedit command. For information on SAVE,
see Appendix B: SeeView Function Key Reference.
For more information and examples related to edit mode, see the description of the
GET command on page 81.
Seedit Commands
This section describes in detail all the Seedit commands. For each command, the
following information is given:
$process
specifies the SeeView process to be moved from its current terminal to the
terminal specified with the TO option.
TO
specifies the new terminal to connect to. If TO is not specified, the current Seedit
terminal is used.
HELLO group.user
specifies the user of SeeView to connect to. You must supply this option if the
SeeView you are connecting to is logged off. If the SeeView is not logged off, your
Seedit must be logged on with the same user ID as the SeeView user ID.
Considerations
You can use CONNECT to move the SeeView terminal in cases of failed
communication ports, workstation reloads, or a user move between geographic
locations.
Moves between different device types might require manual alteration of
FRAMEVIDEO or FRAMEALPHA options for the SeeShell Extras Color option.
Anomalies might also occur when the total number of terminal pages varies from
one device type to another.
SeeViews operating over dynamic TCP/IP or NetBios windows can be made to
wait indefinitely for reconnections by setting ALTER MODEMWAIT 0 so that
SeeView will not abend on an error 140 (modem error). For more information
about MODEMWAIT, see HELP PARAM.
Examples
This example causes the SeeView process name $SEEV to connect to the terminal
where the Seedit CONNECT command was entered.
FILES
The FILES command displays the names of files contained in a subvolume starting
with the specified file, file set, or generic name set.
system
specifies a valid system.
volume
specifies a valid volume. When you specify a volume or subvolume, it becomes the
new default volume for the Seedit task.
subvolume
specifies a valid subvolume. When you specify a volume or subvolume, it becomes
the new default subvolume for the Seedit task.
fileset
specifies a valid file set.
*
specifies either a file set or a generic file-name set.
Examples
These following examples demonstrate the FILES command:
GET
The GET command loads the specified EDIT file into the current window. To enable
edit mode for a window, press F5 or the Line-Insert key. You can then edit the copy of
the file in a manner similar to that of the HPE VS editor.
GET filename [ ! ]
!
creates an EDIT file named filename if it does not already exist.
Considerations
For information about saving files, see SAVE on page 243243.
You can also append information to a file that has been loaded into a cache. To
append information from a file to a cache, use the LOAD statement:
LOAD file-name, cache-id
Example
To exit edit mode, position the cursor on the window sill and enter:
HELP
The HELP command provides a brief description of any of the Seedit commands.
ALL
specifies general help for Seedit.
command
specifies a valid Seedit command.
HELP FILES
HELP GET
INFO
The INFO command displays file information for the specified file, file set, or generic
file name set.
system
specifies a valid system name.
volume
specifies a valid volume name. The volume you specify becomes the new default
volume for the Seedit task.
subvolume
specifies a valid subvolume name. The subvolume you specify becomes the new
default subvolume for the Seedit task.
fileset
specifies a valid file set.
*
specifies either a file set or a generic file-name set.
Examples
The following examples demonstrate the INFO command:
MONITOR [ log-filename ]
log-filename
specifies a valid file name. The file type of the log-filename can be entry,
relative, or unstructured.
Considerations
This command uses both sequential block buffering and control 27 to minimize the
number of messages required to monitor a log file. Control 27 is an operation that
a program can perform against a disk file. The operation notifies the program when
any entity performs a write operation to the disk file. Rather than polling the disk
file to see if it changed, SeeView uses the control 27 operation for greater
efficiency.
The monitor command detects when a log file has been renamed and
automatically switches to a new log file if one exists.
Examples
These examples demonstrate the MONITOR command:
MSG
The MSG command sends message-text to the SeeView programs specified by
distribution.
MSG distribution message-text
message-text
displays text immediately on line 25 of the terminals associated with the specified
SeeView processes.
Considerations
For a SeeView process to accept a MSG or SEND command, that SeeView process
must have a task named MYMAIL as one of its tasks. If a task MYMAIL has not been
declared, the Seedit SEND or MSG command receives a security error 48. Anyone
designing a custom shell that does not coexist with the standard SeeShell needs to
include the following statement in the custom shell to allow the MSG and SEND
statements:
TASK MYMAIL := $my;
Note. The standard SeeShell automatically declares a task MYMAIL as a socket for
MSG and SEND commands.
Example
This example demonstrates the MSG command:
OBEY
The OBEY command causes the Seedit commands contained in the specified OBEY
file to be executed.
OBEY filename
filename
specifies a valid file name.
Example
This example demonstrates the OBEY command:
PURGE
The PURGE command purges (deletes) the specified filename.
PURGE filename !
filename
specifies a valid file name.
!
purges the file without asking you for a confirmation.
Example
This example demonstrates the PURGE command:
RUN
The RUN command executes the specified program.
object-filename
specifies a valid object file name.
startup-msg
specifies text to be sent to the process just started.
Considerations
If R alone is entered (for example, R FUP), the filename is expanded using the
$SYSTEM.SYSTEM subvolume. Otherwise, the filename is expanded using the
current default subvolume. The default subvolume is changed with the VOLUME,
FILES, or INFO command.
volume $data.myvol
r fup { runs $system.system.fup
run fup { runs $data.myvol.fup
SEND
The SEND statement sends the specified command to the SeeView processes
indicated by SeeView-process.
SEND SeeView-process
[ AUDIT ON|OFF ]
[ AUDIT RELEASE ]
[ AUDIT FILENAME disk-filename ]
SeeView-process
specifies the process name of a running SeeView program (such as $VIEW) or the
name of a SeeView object file on disk (such as $SYSTEM.SYSTEM.SEEVIEW).
When you specify a SeeView object file name, all running SeeView programs with
that object file name receive the command. This provides an easy way to
synchronize auditing between multiple SeeView processes.
AUDIT ON|OFF
specifies whether a command history trace is enabled (ON) or disabled (OFF).
AUDIT RELEASE
releases (closes) the history trace file. To create a new trace file, you must
externally rename the trace file and release it.
Considerations
For a SeeView process to accept a SEND command, that process must have a task
named MYMAIL. If a task MYMAIL has not been declared, the Seedit SEND or MSG
command receives a security error 48. Anyone designing a custom shell that does not
Note. The standard SeeShell automatically declares a task MYMAIL as a socket for
MSG and SEND commands.
Example
This example demonstrates the SEND command:
SET
The SET command displays and alters the log file name, the maximum records to be
displayed, or the maximum time the program is to wait for a control 27 to complete
before checking if file EOF changed.
LOGFILE filename
specifies the log file to be monitored with the MONITOR command.
MAXRECS records
specifies the approximate number of most recent records to display when the log
file is first monitored.
MAXWAIT seconds
specifies the maximum time that the program is to wait for a control 27 to complete
before checking if file EOF changed.
Examples
These examples demonstrate the SET command:
SUBVOLS
The SUBVOLS command displays the names of subvolumes on the specified system
and volume.
system
specifies a valid system name.
volume
specifies a valid volume name.
subvolume
specifies a valid subvolume name. Specifying a subvolume causes the display to
begin with subvolume rather than the first subvolume on the specified volume.
*
specifies all subvolumes.
Example
This example demonstrates the SUBVOLS command:
SYSTEM
The SYSTEM command sets and displays the current default system, if any.
SYSTEM without \system name sets the system back to the original system.
SYSTEM [ \system-name ]
system-name
specifies a valid system name.
SYSTEM \NEWYORK
SYSTEM
USERS
The USERS command displays the process names of SeeView programs on a
specified system.
USERS [ object-filename ]
object-filename
specifies the SeeView program desired.
Examples
These examples demonstrate the USERS command:
VOLUME
The VOLUME command allows the default volume and subvolume to be modified.
volume
specifies a valid volume.
subvolume
specifies a valid subvolume.
Examples
These following examples demonstrate the VOLUME command:
VOLUME $DATA.MYSUBVOL
Statements
Section 9: SeeView Statements and Script Symbols presents all the SeeView
statements alphabetically and describes them in detail. You can use SeeView
statements in the following basic ways:
Conditional Execution: To execute statements conditionally, use the IF, WHILE,
or DO...UNTIL statements.
Comments: To add comments to the current line, type a left brace character and
then type your comments to the end of the line:
{ this is a comment
Iteration:
To execute statements repetitively, use the FOR, WHILE, or
DO...UNTIL statements. For example:
FOR 5 DO { The following statement is executed 5 times.
BEGIN
statement;
statement;
END;
Program Structure
SeeView programs consist of sections, procedures, and menus. These program
elements have the following functions:
A keyword prefixed by a question mark in the first character position of a line is called
an interpreter directive. An interpreter directive provides structural information to the
SeeView program about the text following the directive. ?SECTION, ?PROCEDURE
and ?MENU are interpreter directives. (See Section 8: SeeView Directives.)
Sections
Sections declare logical groups of SeeView statements that are executed immediately
when a SeeView source file is invoked.
? SECTION section-name indicates the beginning of a section in a SeeView source
file. Most SeeView programs have only one section.
When you first start the SeeView program, it determines the name of its shell file and
executes all sections contained in that shell file. The SeeView program also executes
sections in a shell file or script when an INVOKE statement references a file containing
SeeView statements or when the execute-current-shell function key, SF15, is pressed.
This provides a mechanism for calling external SeeView programs and menus (for
example, INVOKE filename) or for reinitializing the current environment (for
example, SF15).
When a SeeView script is invoked, line 25 displays status messages that indicate what
section is being executed. If an error occurs, a message displays the source file and
section where the error occurred. When the SeeView program finishes processing a
section successfully, it indicates the source file and section name that generated the
display.
Sometimes a program generates one terminal page per section. This section-per-
display-page orientation forms a logical way to group statements.
Procedures
Procedures declare logical groups of SeeView statements that are executed with a
CALL statement. Procedures are callable anywhere a SeeView statement is permitted.
You can associate statements and procedures with a menu.
?PROC proc-name indicates the beginning of a procedure.
The PARM statement declares procedure parameters. Parameters can be passed
either by value or reference. They can be integer or string expressions.
Parameters are optional. You can specify a default parameter value to be used if the
caller does not supply the parameter value when calling the procedure. Example 5-2
shows a simple SeeView program with a procedure.
?SECT main
{---------}
PAGE 2; CALL Listdev; { On page 2 display PUP LISTDEV DISC
PAGE 3; CALL Listdev ("tape"); { On page 3 display PUP LISTDEV TAPE
Use the VARIABLE (or VAR) statement to declare integer and string variables within a
procedure. These variables are local in scope. You can use the PRINT* statement to
display local procedure variables and their values after a procedure is executed, which
helps in debugging.
In addition to the parameters passed to a procedure, built-in string intrinsics provide
global information regarding the current SeeView environment. For more information
on string intrinsics, see
Menus
The ?MENU directive declares the name of a text cache and the contents of that
cache. Each line of text following the ?MENU directive is stored in the text cache
associated with that name.
You can use the SORTED option to sort the cache records in ascending order. The
syntax for the SORTED option follows. It is described in detail under
TASK on page 255255.
SORTED [ "["start [:end ] "]" ]
The WINDOW statement displays the text stored in a cache. A window that references
a text cache can be a simple window that displays the text in the cache or a window
declared as a menu. When you declare a window as a menu, you can associate
SeeView statements and procedures with each line of text. When you point the cursor
to a line of text in a menu and press Return, the statements and procedures
associated with that line are executed.
Menu Productions
Menu productions represent menu items that you can invoke. Menu productions are
lines of text in a ?MENU cache that contain the left arrow symbol (<==). A menu
production can include one or more statements. To execute the statements associated
with the production, point the cursor to that line in a menu and press Return. When a
production includes a CALL statement, the statements in the called procedure are
executed.
For example, the following line in Example 5-3 is a menu production:
Disk <== CALL Listdev ("disc")
To invoke a production, point the cursor to that line in a menu and press Return. The
text to the left of the production symbol is the text that appears in the menu. To the
?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
When you point the cursor to a menu line representing a device type and press Return,
a PUP Listdev for the selected device type appears next to the device type menu, as
Figure 5-1 shows.
vst501
Default Productions
You can declare menus with a default production. When you declare a default
production for a menu, the text lines that do not have a production associated with
them automatically use the default. The default production lets you associate common
procedural rules with a list of objects. (See Example 5-4.)
?MENU DevTypes declares the names of device types. Only the Expand object
requires an explicit production because the object name Expand is unknown to
PUP. The other object names, Disk, Tape, Term, and Printer, are known to PUP.
?PROC Listdev displays a list of devices of the selected device type in a window
beside the caller‟s menu by using the PUP LISTDEV command.
?PROC HelpDev displays a simple advisory help message indicating what will
happen when you press Return or Shift-Return.
?SECT Main displays the initial device type menu and associates the default
production “CALL Listdev(#MENUTEXT)” with the menu.
You execute a default production when you point the cursor to a menu item that does
not contain a production symbol and press Return.
Pull-Down Menus
Menus can display other menus and windows through the use of the WINDOW
statement. See Example 5-5.
?MENU MyMenus declares the name of a text cache used for different menus.
You need not declare separate menu caches for each menu to be displayed. The
CACHE target option of the WINDOW statement enables you to navigate
through a cache searching for a target text object.
?PROC PullDown displays a list of menu options below the caller‟s menu by using
the WINDOW [ ] MENU CACHE #target statement.
?PROC Listdev displays a list of selected devices in a window adjacent to the
caller's menu by using the PUP LISTDEV command.
?SECT Main displays the initial Devices and Utility menus.
Productions can invoke other SeeView programs or scripts contained in EDIT files or
caches by using the INVOKE statement. This provides a way for menus to invoke
external menus and sections, as well as declare external procedures. This permits
extensible development and maintenance of external menus and procedures. The
External menu item under SeeView Extras provides an example. (See Example 5-15
and Example 5-13.)
Example 5-5 provides an example of a SeeView program that uses menus to provide
device type options and system utility functions. When you select a menu item
referencing the PullDown procedure, a menu is pulled down below the calling menu.
See Figure 5-2.
vst502
?SECT Main
{---------}
VAR #BackupOptions := "$TAPE, " & #VOLSUB & ".*, LISTALL"
,#RestoreOptions := "$TAPE, " & #VOLSUB & ".*, LISTALL"
;
PAGE 2;
WINDOW MyMenus MENU CACHE FIRST UNTIL /*/ SIZE 13 HEAD "";
?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-3Error!
Bookmark not defined..) 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.
vst5-3
Variables
You can define three types of symbolic variables in the SeeView environment: integer,
string, and task.
Integer or string variable names can be any combination of alphanumeric characters
up to 16 characters in length. Task variable names can be any combination of
alphanumeric characters up to 15 characters in length.
The VARIABLE statement declares integer and string variables. DECLARE (DEC) and
VARIABLE (VAR) are synonyms that you can use interchangeably.
Integer Variables
Integer variables represent 16-bit signed integers. For example:
TASK psmail;
VAR x := 70*3 { 210
,y := x/4 { 52
,z := y * "2" { 104
,t := psmail { PSMAIL's numeric taskid
;
String Variables
String variables represent strings of up to 132 ASCII characters and have an implicit
length associated with them. You must prefix string variable names with the string type
flag #. (See the description for the # sign on page 295.)
WITH PSMAIL;
VAR x := 70*3,
y := x/4,
#s := "Time " & #TIME & " Date " & #DATE[1:8] & " X*Y=" & x*y,
#t := #DROP #s { "Time " gets dropped from string #s,
#z := " With task is " & #TASKSYMBOL & " on page " & #TASKPAGENO;
You can use string variables anywhere a string expression is permitted. To display the
contents of a string variable or string expression, use the PRINT statement.
Task Variables
The
TASK statement declares a symbolic taskid name that is associated with a program
on a NonStop system. Various SeeView statements can communicate with the task.
Task variables remain in effect while the SeeView program is executing.
Certain TASK statement options (for example, CACHEPAGES) are meaningful only
the first time the TASK statement is successfully executed. The CACHEPAGES option
determines the size of the message cache memory associated with the user task.
Expressions
The term expression refers to any combination of:
x = true (minus-one value) if #s starts with an ASCII string of numeric characters
greater than 10.
x = false (zero value) if #s starts with an ASCII string of numeric characters less
than or equal to 10.
Run-time error "Input conversion #s" if #s contains a value that is too large (greater
than 32767) or begins with nonnumeric characters.
Operations between mixed types of expressions (for example, integer and string)
convert string data to internal arithmetic values automatically. Relational comparisons
between strings such as (#a > #b) result in a relational string comparison, not a
relational arithmetic comparison.
Integer Assignment
Integer assignment statements begin with the optional keyword LET and follow first
with the integer variable, then with the := assignment operator, and finally with the
expression to be evaluated and assigned to the integer variable.
You can also specify integer assignment by using designational expressions anywhere
an expression is permitted. For more information on designational expressions, see
the description for the
Parentheses ( ) on page 293293.
These examples show integer assignment statements:
String Assignment
String assignment statements begin with the string type flag character #. To
concatenate strings, use the & (ampersand) character. To parse tokens, use the string
operators #TAKE, #DROP, and #TRIM. You can index string variables on either side of
the statement. For more information on string assignment, see the description for the
Pound Sign # on page 295295.
These examples show string assignment statements.
String Intrinsics
String intrinsics are built-in read-only variables that return string values intrinsic to the
SeeView environment. Begin string intrinsics with the string type flag (#) and follow
them with any of the string intrinsic keywords described under
The cursor location when the Return key was last pressed (#FKEYCOL,
#FKEYLINE)
The attributes of the task defined to SeeView through the WITH statement
(#TASKSTOPPED, #TASKPROMPTING, #TASKPAGENO,
#TASKOBJECTNAME)
String Operators
String operators are built-in string functions that perform operations on string variables
and intrinsics.
String operators return the size of a string variable or intrinsic (for example, #SIZE #s).
They also perform token operations on a string, such as TAKE, DROP, or TRIM tokens
in a string.
The TRIM function returns the first token in a string variable and removes that token
from the contents of the string variable. For example:
If the first nonblank character is alphabetic, the token consists of that character
and all the following alphanumeric characters.
If the first nonblank character is numeric, the token consists of that character and
all the following numeric characters.
If the first nonblank character is special (neither alphabetic nor numeric), the token
is a one-character token.
Modal Environments
Modal prompts constrain the SeeView environment so that you can respond only to a
single prompt or dialogue box. The word modal indicates that the environment enters
a mode that has special limitations placed on what you can do.
Modal prompts are useful for certain situations, but they have these disadvantages:
Other windows, menus, and prompts do not work during the modal prompt.
Built-in value-added functions such as paging, scrolling, and editing do not work
during the modal prompt.
Modal Prompts
To set up a modal prompt, use the ACCEPT statement FKEYWAIT option. Example 5-
8 Error! Bookmark not defined. shows a program that uses a modal prompt. The
directives of this script function as follows:
?MENU Scratch declares a scratch cache to store prompt production images.
?PROC Prompt uses the input parameter #prompt to build a prompt production
and store it in the scratch cache. A menu window is displayed on the formatted
prompt production. The ACCEPT statement FKEYWAIT option is then executed.
During the FKEYWAIT, you can use no other menus or windows. When you press
a function key, the ACCEPT statement completes. The prompt is then cleared, and
the response to the prompt is returned in output parameter #answer.
?PROC Fileinfo uses parameter #subvol to display FUP information for #subvol.
?SECT EnterSubvol is executed when the script is invoked.
?MENU Scratch
?PROC Prompt(#prompt,#answer)
{---------------------------- { Proc does a waited prompt.
PARM #prompt IN, { Format of <Prompt>[<response>]
#answer OUT; { Response returned in #answer.
?SECT EnterSubvol
{---------------- { Popup up a prompt for subvol
VARIABLE #subvol; { Variable to contain subvol.
BESIDE; CW; { Position beside caller menu.
?SECT EnterSubvol declares a global variable #subvol and positions the screen
buffer address beside the calling menu so that the prompt appears beside the
caller‟s menu.
vst5-4.vsd
When you press a function key, the ACCEPT statement completes, the prompt is
erased, the procedure returns the user response text “$DATA.SEEC20” in the #subvol
parameter, and ?PROC Fileinfo displays the output shown in Figure 5-5.
vst5-5.vsd
Modeless Prompts
A modeless prompt is established when you associate a production with a window.
Example 5-9 is an example of a program that uses a modeless prompt. The directives
of the script function as follows:
?MENU Scratch declares a scratch cache to store window text images.
?PROC Prompt uses the input parameter #prompt to build a prompt production
and store it in the scratch cache. A menu window then appears on the formatted
prompt production. The procedure uses the input parameter #action as the default
menu production for this Prompt window. This #action production tells SeeView
what to do when you point to the prompt and press Return. Once this window has
been declared, the procedure returns control to the SeeView program so that you
can use this prompt as well as any other menu, window, or prompt.
?PROC FileInfo uses input parameter #subvol to display FUP INFO * output for
#subvol.
?MENU scratch
?PROC Prompt(#prompt,#action)
{---------------------------- { Proc does a nowaited prompt.
PARM #prompt IN, { Format <Prompt>[<response>]
#action IN; { Production to execute
?SECT EnterSubvol
{---------------- { Popup up a prompt for Subvol
BESIDE; CW; { Position beside caller menu.
The production associated with the window is executed “BELOW; CALL
FileInfo(#menuinput)”.
The text contained in the prompt field, “$DATA.SEEC20”, is passed to the ?PROC
FileInfo via the intrinsic #menuinput.
vst5-6.vsd
?MENU Person
{-----------}
First [ ] Last [ ] :: (alpha) (alpha)
Address [ ]
City [ ] State[ ] Zip[ ] :: (a) (a) (n notab)
*
?SECT Main
{---------}
CALL PutPerson("John", "Smith", { Display person
"500 Main Street", { window with
"Chicago","IL","60172"); { initial data.
?MENU Person declares a cache named “Person” and stores the format of the
Person screen in that cache. Cache elements containing field attribute productions
( :: ) define the domain of acceptable input values for those fields.
?PROC PutPerson receives the initial values for a person in its input parameters.
The procedure then declares a WINDOW on the Person cache with a default
production of “CALL GetInput” and with the FIELDS (underline) format option
specified. This WINDOW statement displays the input-output dialog box shown in
Figure 5-7.
vst5-7.vsd
To determine the field attributes for each field in a FIELDS window, use the default
attributes of the WINDOW FIELDS option in combination with the individual field
attributes specified by the field attribute productions stored in cache. Thus the field
attributes for the field Zip are underline, numeric, notab. For a complete description of
field attributes, see the WINDOW statement in Section 9: SeeView Statements and
Script Symbols.
Once the Person window is declared, the DISPLAY statement displays the parameter
values #first, #last, ... in the person WINDOW. The action of the DISPLAY statement is
a function of the current screen buffer address. To update any input-output field
window, you only need to specify the screen buffer address of that window and
execute a DISPLAY statement. The fields in the window are updated in left-to-right,
top-to-bottom order.
?PROC GetInput is called when you press Return because “CALL GetInput” is the
default production associated with the Person window. (The KEYS option also causes
F5, F6, or F7 to call ?PROC GetInput.) When the procedure is called, it calls ?PROC
GetPerson to accept the current data values into local variables #first, #last, ... from
the fields in the Person window. These values are then added to the People cache,
and a window appears on the People cache.
Specify the initial value of a field by placing the literal text that is to appear in the
field after the start field delimiter. For example, the First name field in Example 5-
11 contains the literal text “John” after the left square bracket start field delimiter.
Update fields with a DISPLAY statement that uses string expressions. For
example, the Last name field in Example 5-11 is updated with the statement
DISPLAY “Smith”.
Enter a string variable name in a field to display that variable‟s value in the field
when a window displays that field with the FIELDS option. For example, the
Address field in Example 5-11 displays “500 West Main”, the value of the variable
#address, when the WINDOW statement in the ?SECT main is executed.
Use the DISPLAY statement FROM option to update fields with data contained in
another cache. For example, the City, State, Zip fields in Example 5-11 are
updated with the statement:
DISPLAY FIELD 3 FROM CityStateZip;
?MENU Person
{-----------}
Last [ ] First [John ] :: (alpha) (alpha)
(1)
Address [#address ]
(3)
City [ ] State[ ] Zip[ ] :: (a) (a) (n notab)
*
?MENU CityStateZip
{-----------------}
Chicago
IL
60172
?SECT Main
{---------}
VAR #address := "500 West Main";
DISPLAY "Smith";
(2)
?MENU Person defines the input-output screen image for the Person screen. The
text “John” and #address are copied into the cache along with the rest of the
screen images.
?MENU CityStateZip stores the city, state, and zip code in a cache named
CityStateZip.
?SECT Main declares a variable named #address and initializes that variable to a
value of “500 West Main.” A window is displayed on the Person cache as shown in
Figure 5-8. When the window is displayed, the text “John” is displayed in the First
name field and the text “500 West Main” is displayed in the Address field.
The statement DISPLAY “Smith” updates the Last name field with the text “Smith.” A
list of string expressions is also acceptable. This example would also result in the
display shown in Figure 5-8:
DISPLAY "Smith","John","500 West Main","Chicago","IL","60172"
This statement updates the City, State, and Zip code fields by using the values
contained in the CityStateZip cache:
DISPLAY FIELD 3 FROM CityStateZip
vst5-8.vsd
Function Keys
The WINDOW statement KEYS option associates function keys with windows in the
SeeView environment. See the Main section of Example 5-12.
?MENU Person
{-----------}
Last [ ] First [ ] :: (alpha) (alpha)
Address [ ]
City [ ] State[ ] Zip[ ] :: (a) (a) (n notab)
*
?MENU PersonData
?PROC PersonMaint
{----------------}
{ Maintains Person SQL Table, F5 add, F6 delete, F7 list.
{-------------------------------------------------------}
VAR #first, #last, #data;
TASK SQLci; { Declare SQL ci.
LINE #menuline, #menucol; { Address calling window.
DELETE PersonData!; { Clear person cache.
?SECT Main
{---------}
WINDOW person CACHE FIRST UNTIL "*" SIZE 43
MENU "CALL PersonMaint"
FIELDS (underline)
KEYS F5, F6, F7
HEAD "Add-F5 Del-F6 List-F7";
?SECT Main displays the Person window (or dialog box) shown in Figure 5-9.
?PROC PersonMaint is called when you press F5, F6, or F7. PersonMaint starts a
SQL conversational interface (SQLCI) session, clears the PersonData cache, and
then accepts the data from the Person window into the PersonData cache. If you
press F5, commands are issued to the SQLCI to insert the accepted data into the
SQL Person table as Figure 5-9 shows.
Figure 5-9. SeeView Output From the Program in Example 5-12 When F5 Is Pressed
vst5-9.vsd
The procedure PersonMaint is called when you press F7. The procedure issues the
SQLCI command to list records stored in the SQL Person table, shown in Figure 5-
10Error! Bookmark not defined..
Figure 5-10. SeeView Output From the Program in Example 5-12 When F7 Is Pressed
vst5-10.vsd
Window Productions
The WINDOW statement PRODUCTION option associates a default production with
nonmenu windows. This option can even associate a production with an edit-mode
window.
?MENU Dictionary
{---------------}
Apple = A round, firm, fleshy, edible fruit with a
green, yellow, or red skin and small seeds.
*
Banana = A long, narrow, somewhat curved fruit that has a sweet,
creamy flesh covered by a yellowish, or reddish skin.
*
Orange = A reddish-yellow, round, edible citrus
fruit, with a sweet, juicy pulp.
*
?PROC Webster( #word )
{--------------------} Lookup #word in dictionary
PARM #word;
VAR WordFound;
?MENU Dictionary declares a cache named Dictionary and stores the definitions of
the words that follow the ?MENU directive.
?SECT Main starts a Seedit task and displays a window on the Seedit task. The
window has the production “CALL Webster(#MENUTOKEN)” associated with it.
This production is executed when you press a function key that was specified with
the WINDOW statement KEYS option.
?PROC Webster is called when you press SF10. The #word of text selected by the
cursor position is passed to the procedure via the #MENUTOKEN intrinsic. The
procedure then searches the Dictionary cache for the #word.
vst5-11.vsd
Invisible Fields
The BLANK field attribute defines invisible, or blank, input-output fields.
Example 5-14 shows a program that uses the BLANK field attribute to suppress the
display of data entered into the Password field of a logon screen.
?MENU LogonScreen
{-----------------}
Group [ ] User[ ] :: (u) (u) <== CURSOR #fkeyline+1;
?PROC Logon
{----------}
{ Accept group, user, password. NOTE script is modeless
{------------------------------------------------------}
VAR #group, { will contain group name
#user, { will contain user name
#password, { will contain password
ok; { true indicates logon ok
LINE #menuline,#menucol;
ACCEPT #Group, #User, #Password;
?SECT Main
{---------}
SECURE F1 F2 SF1 SF2;
PAGE 1; CLEARW;
WINDOW LogonScreen MENU FIELDS
CACHE FIRST UNTIL "*" SIZE 40
HEAD "Please Logon";
?MENU LogonScreen declares the definition of the logon screen. The logon
screen uses field attribute productions to declare the field attributes of each of the
fields that will appear in the logon screen.
You can use a field attribute production (::) and a script production (<==) on the
same cache line. For example, in the line defining the Group and User fields, the
field production :: (u) (u) indicates that the Group and User fields should be
underlined, and the script production <== CURSOR #fkeyline+1 causes the cursor
to move to the next line when you press Return.
The Password field production :: (R BLANK) causes data entered in this field to be
invisible, or blank, and sets reverse video for it.
?SECT Main displays the logon screen window shown in Figure 5-12. The Main
section secures function keys F1, F2, SF1, and SF2 to prevent users from going to
other pages of the environment before logging on.
?PROC Logon is called when you press Return with the cursor in the Password
field. The procedure accepts the Group, User, and Password field data and then
searches the ValidUsers cache for a match. If none is found, you are denied
access. If the group, user, and password are found in the valid users cache, you
are allowed access (logged on), and the output in Figure 5-12 appears.
vst5-12.vsd
?MENU Person { Define Person dialogue box and associated field values
{-----------
First [ ] Last [ ]
Address[ ]
City [ ] State[ ] Zip[ ]
Phone [ ]
*
<First> { Values for First name field above.
Robert
John
Jessica
*
<Last> { Values for Last name field above.
Johnson
Smith
Thompson
*
<Address> { Values for Address Field above.
18922 Forge Drive
19333 Vallco Parkway
*
<City> { Values for City Field above.
Chicago
SanFrancisco
*
<State> { Values for State Field above.
IL
CA
*
?PROC OfferList
{--------------
{ Display a menu of legal values for the selected field.
{ Using the field <label> to the left of cursor, search cache
{ for this <label> and display menu of values for the field.
{ For example: If Return is pressed in First name field the
{ intrinsic #menutext = First [ ] Last [ ].
{ We search cache to find the <First> values for this field.
{ If "<First>" is found in cache, the <First> values are displayed
{ in a menu, and the original panel is protected (using DISPLAY
{ VIDEOTEMP option). Note that this presents the user with what
{ appears to be a Modal screen, because they can't access the
{ parent dialogue box. However, the script is in fact modeless
{ because it doesn't require an ACCEPT FKEYWAIT.
{
{ Some human factors people believe that these modal screens
{ are easier for less experienced users to use. More experienced
{ users may find such modes confusing and overly restrictive
{---------------------------------------------------------------
VAR cursorIndex { Index of cursor in menu
,#fieldName { <name> of field pointed to by cursor
, fieldline:=#fkeyline{ Screen Line location of selected fld
, fieldcol { Screen Col location of selected fld
, nextline:=#fkeyline { Screen Line of next field
, nextcol { Screen Column of next field
,#s:=#menutext { scratch
, i
;
CursorIndex := #fkeycol-#menucol; { Position in menu
scan #s[ CursorIndex ] until "[" -> nextcol; { Find next fld on
if not nextcol then begin { screen. This is
nextline:=nextline+1; { the field after
nextcol:=#menucol; { the cursor
end;
scan back #s[i-1] while " " ->i; { find end of label
?MENU declares the definition of the Person dialog box. The Person cache
contains both the screen definition and the values for each field in the screen.
vst5-13.vsd
When Return is pressed with the cursor in the First name field, as shown in Figure 5-
13, ?PROC Offerlist is called. The procedure uses the text to the left of the cursor to
build a label that represents the name of the field. This label is stored in the local
variable #fieldName. The label is then used to search the cache associated with the
Person dialog box. If the label is found, a menu of the values associated with the label
appears, as shown in Figure 5-14Error! Bookmark not defined..
Figure 5-14. Output When Return Is Pressed in the First Name Field
vst5-14.vsd
The Person dialog box shown in Figure 5-14 is protected while the menu of FIRST
name values is displayed. This presents users with what appears to be a modal screen
because they cannot access the parent dialog box. However, the script is in fact
modeless because it does not require an ACCEPT FKEYWAIT statement.
When either Return or F16 is pressed in the menu of FIRST names, shown in Figure
5-14:
?PROC InsertText is called. If Return was pressed, the procedure inserts the
selected FIRST name (contained in #menutext) into the First name field located at
FieldLine and FieldCol. If F16 was pressed, no value is inserted.
The FIRST name menu is then erased from the screen by using a CLEARW
statement, the parent Person menu is made accessible once again by using the
DISPLAY VIDEOTEMP ( ) option, and the cursor is positioned appropriately, as
shown in Figure 5-15.
vst5-15.vsd
Repeatedly pressing Return with the cursor in the Person dialog box causes the
Person fields to be updated, as shown in Figure 5-16Error! Bookmark not defined..
vst5-16.vsd
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-17Error! Bookmark not defined. shows.
?MENU Config
{-----------}
PROGRAM Filename[ ] :: (alphanum)
Command [ ]
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.
?PROC GetConfig is called when you put the cursor in the Config window and
press Return. The procedure accepts the data fields from the screen, declares the
specified task, performs context checks on the input variables, issues a command
to the task, and displays a window on the specified task as shown in Figure 5-
17Error! Bookmark not defined..
vst5-17.vsd
?SECTION ReadReceive
{-------------------}
VAR secs:=300, { $Receive timeout in seconds
#request, { Request from $receive
error; { Error= 0 write, 1 writeread, 40 timeout
{ Declare requestor $receive socket
TASK requestor:= $xxxx TIMEOUT secs,secs;
DO BEGIN
READ requestor PEEROK, #request, error;
MSG #TIME &" $SEEV Received: "& #request;
IF error=1 THEN CALL HandleRequest(#request, #TASKIDLASTREAD);
When the SeeView program executes the script shown in Example 5-17, ?SECTION
ReadReceive declares a request taskid socket named Requestor. The section then
repeatedly reads the Requestor $receive socket. Each time a message is received, the
READ requestor PEEROK statement completes. If SERVERMODE=3, the request
appears as shown in Example 5-18.
Each time a WRITEREAD message is received, the ?PROC HandleRequest is called
to process the request contained in string variable #request. The taskid of the
requestor is also passed to the ?PROC HandleRequest with the intrinsic
#TASKIDLASTREAD. This intrinsic determines the taskid number of the last message
received since the PEEROK option was used.
Example 5-18. Server Output From the ServerMode Script in Example 5-17
INFO $DATA.TEST.*
CODE EOF LAST MODIF OWNER RWEP TYPE REC BLOC
$DATA.TEST
A 0 15:08 66,1 UUUU
B 0 15:09 66,1 UUUU
C 0 15:09 66,1 UUUU
D 0 15:09 66,1 UUUU
-
Have your scripts use page 1 of the terminal and then page 2 if you need it. This
simple rule is probably the most important one because most users have multiple
processes going on at the same time with many windows open on other pages. If
your script opens windows at random on other pages and removes other windows
from the screen, not only will you disrupt the environment, you will confuse the
user. As a general rule of thumb, pages 1 and 2 are reserved for the shell and
external scripts, and all other activity takes place on the remaining pages (page 3
through the last page).
Design your scripts so they do not disturb the operation of the shell. You should
preserve the menus at the top of page 1 at all times. If you do not, you limit
severely the powers that common SeeView users are accustomed to, and they will
probably refuse to use the script because it manipulates their environment.
Do not alter color settings. Once colors are changed, menus start to look like
windows, and windows start to look like menus. Such changes can be confusing.
Do not lock any of the function keys (through the SECURE command). Most users
who encounter a script that locks function keys will shut it down and purge it.
Leave the function keys unlocked unless you are writing a stand-alone shell for a
closed application environment.
Standard: An item within a menu that executes commands or displays information
when selected.
Input:An input field within a menu where text can be entered, followed by a
carriage return. Also referred to as a prompt or input production.
Toggle: An item whose Boolean value changes when selected. The new value of
the item appears within the menu.
Select: An item that offers a list of values when it is selected. The new value of
the item appears within the menu if a new value is selected.
Some scripts utilize all four types of menu items. Others only need standard menu
items.
The Toggle and Select menu items are useful for syntactically complex commands.
They provide extensibility when dealing with commands that have many attributes.
Toggle and Select menu items are used to minimize the chance of user error. Although
Toggle and Select menu items provide more variability in an interface, they can also
make the interface more confusing to use. If you are willing to limit some of the power
of an interface in exchange for ease of use, you might limit the initial design to
?MENU mymenu
-DevTypes
DISC
PRINTER
TAPE
*
-Commands
LISTCACHE
LISTDEV
. . .
*
?SECT main
WINDOW mymenu MENU ___________
CACHE /-DevTypes/ | DISC |
UNTIL /*/ | PRINTER |
HEAD "" | TAPE |
OFFSET 0,1; |___________|
Window Sills
You can execute SeeView statements directly by entering them on a window sill and
pressing Return or, if the window is not free, Shift-Return. You use the OPEN
statement often in this manner.
Entering HELP from a free window provides a summary of all SeeView statements and
function key operations. Entering HELP statement or HELP function-key
provides a reference description of the statement or function key specified.
Menu Production
You can also execute statements from menu productions. If you place the cursor in a
window declared as a menu and press Return, the line designated by the cursor is
analyzed to determine if it contains a production symbol (<==). If it does, the SeeView
statements to the right of the symbol are executed. This provides an extremely simple,
and convenient way to execute SeeView statements.
SeeView statements can also be associated with menu items that do not contain a
production symbol. The WINDOW statement lets you associate a default production
and a shift production with a menu. You can execute a default production by pointing
the cursor to a menu item that does not contain a production symbol and pressing
Return. You can execute a shift production when you select any menu item and press
Shift-Return.
Default productions and shift productions provide a powerful way of associating
procedural rules with entire sets of menu items and the objects that they represent.
Edit-Mode Windows
You can interactively develop and execute a SeeView program from a window that is
in edit mode on the Help page. This virtual window interface to the SeeView interpreter
provides a simple way to develop and debug SeeView programs.
The following steps load the current shell into a special window labeled SeeView on
the Help page. Once you load a program into the SeeView window, you can debug it.
You can use the Seedit GET command to load any program or script file into the
SeeView window.
To set up the Help page for interactive debugging:
1. Press F11.
Once the Help page appears, press F11 a second time. A window editor labeled
SeeView is automatically created in the largest free window on the Help page.
Breaking up this window into a larger SeeView window and a smaller free window
below it provides a convenient means of displaying syntax errors and user variable
values.
2. Load the SeeView command files into the SeeView window on the Help page by
using the Seedit GET command.
3. Enable edit mode for the SeeView window by pressing Insert-Line or F5 when the
cursor is on the sill of this window.
4. Once the editor is enabled, press SF15 when the cursor is in this window to
execute all statements contained in the cache for this window.
If the program causes another page to appear, you can return to the Help page by
pressing F11.
Specifying a section through the ALTER SHELL file [ ( section-name) ] statement
restricts SF15 execution to a specific ?SECTION section-name within the target
shell.
VST701
The numbers 8 (2,9) at the end of the error message in Figure 7-1 indicate:
The source file sequence number where the error occurred (line 8). (If you enter
LIST line-number on the sill of an edit-mode window and press F12, you
position the cursor on that line number.)
The line number in the current procedure or section (line 2 of section Main).
The column number where the error was detected (column 9).
Example 7-1 shows an example of a user-defined SEECSTM script that provides
vectoring to different terminal pages based on the menu item selected.
?SECT Main
{---------
{ Popup mymenu below last referenced menu
{----------------------------------------
BELOW; { Position below caller's
CLEARW; { menu, and clear any windows.
WINDOW MyMenu MENU CACHE UNTIL /*/; { window on mymenu menu
MENU
The ?MENU directive declares a menu taskid name and the contents of the cache
memory associated with that name. Each line of text following the directive is stored in
the cache defined by taskid.
The WINDOW statement displays the cache contents in windows or menus. When you
declare a window as a menu:
Each line of cache containing the production symbol (<==) represents a menu item
that you can invoke by pressing Return. For example:
Viewsys <== run viewsys
The prompt production symbol (<==?) represents a menu item that you can invoke
and have data passed through an input field defined on the left side of the
production symbol. For example:
Enter \system: [ ] <==? #system := #menuinput
To invoke a production, place the cursor on that production‟s line in a menu and press
Return.
The text on the left side of the production symbol is the text that you see in the menu
window. On the right side of the production is a set of statements that the SeeView
interpreter executes.
The TASK statement syntax portion of the ?MENU directive enables you to specify
menu options. These options include TASK statement options. Common TASK
statement options that you might want to use with the ?MENU directive include the
CACHEPAGES and SORTED. For detailed descriptions, see the
TASK statement in Section 9: SeeView Statements and Script Symbols.
?MENU items
{---------}
Dates <== CALL dates { call parm = ""
Today <== CALL dates ("today") { call parm = "today"
January <== CALL dates ( "1/1" ) { call parm = "1/1"
February <== CALL dates ( "2/1" ) { ..
March <== CALL dates ( "3/1" )
April <== CALL dates ( "4/1" )
May <== CALL dates ( "5/1" )
..
December <== CALL dates ("12/1" )
[ ? ]<==? CALL dates (#menuinput) {
?SECT ShowMenus
{-------------}
{ Show initial base menus
{------------------------}
VAR h := 3; {default front page menu height
VAR w := 13; {menu width
PAGE 1;
?PROC procedure-name
The lines of text following the ?PROC procedure-name directive represent SeeView
statements associated with procedure-name. Another directive, or end of file,
marks the end of the procedure.
Use the PARM declaration within a procedure to reference string and integer
parameters passed by the CALL statement. String Intrinsics provide additional
information regarding the current calling environment. (See also HELP #, #MENU..
#TASK...intrinsics, and WITH statements.)
You can invoke procedures from menus, sills, other procedures, or another shell
environment such as SEECSTM. A procedure can display a menu, which can invoke a
procedure, which in turn can display a menu, and so on. This technique helps to
formalize and externalize the calling interface between procedures and menus and
promotes user control of complex functions.
For an example of a procedure called from a menu, see Example 8-1Error! Bookmark
not defined..
SECTION
The ?SECT interpreter directive identifies groups of SeeView statements that are
automatically executed when you invoke a script file or cache with the INVOKE
statement or SF15, or when you first start a SeeView program.
?SECT section-name
When you press SF15, sections are executed in the shell file or cache defined by
the ALTER SHELL statement. Press SF15 to reinvoke the shell setup (for
example, SeeShell).
SEEVIEW
The ?SEEVIEW interpreter directive identifies the version of the SeeView interpreter
needed to execute the script containing this directive. If the version of a SeeView
program is older than the directive specifies, the old version of SeeView does not
execute the script and issues a warning message. You can protect new scripts that
use new SeeView syntax from accidentally being executed by older versions of the
SeeView interpreter.
?SEEVIEW version
The version has a format of Vxx or VxxSPR, where V represents the general
software release series, xx represents the release version (D40, for example), and
SPR represents the SPR version (such as D40AAD).
Example 8-2 shows how to use the SEEVIEW directive.
?PROC PassFkeyCmd(tid);
{---------------------}
{ Pass fkey pressed to taskid=tid along with cmd on the sill
{ Note that the task expects the terminal fkey data stream,
{ so we must build the <SOH> <fkey> <row> <col> data stream.
{-----------------------------------------------------------}
PARM tid;
VAR #s
, #fkeyTransform:= "@ABCDEFGHIJKLMNO" & { f1..f16
"`abcdefghijklmno" & { sf1..sf16
"PQRSTUVW" & "pqrstuv" { others
, #fk:=#char(1) & { <soh>
#fkeyTransform[#fkey] & { <fkey> code
#char(32+0) & { <row>
#char(32+#fkeycol-#menucol-1) { <column>
;
WITH tid; { pickup old prompt
Brackets [ ] The left bracket begins the display of a list of strings, and
the right bracket ends it.
Delimits an end-of-line comment.
Left Brace {
Quotation Mark “ Displays string expression at current address.
Pound Sign # Begins a string assignment statement, string operator, or
string intrinsic.
String operators return information about the contents of
String Operators and a string variable. String intrinsics return information about
String Intrinsics the entities they represent.
ACCEPT
The ACCEPT statement reads fields from the screen and stores this information in
string variables or a message cache.
Use the ACCEPT statement to read data from the terminal screen and store this
information in a list of user-defined string variables or in the cache associated with a
taskid. You can specify both a list of string variables and a cache taskid for the same
ACCEPT statement.
The screen area to be accepted is defined by the area of the window located at the
current buffer address unless you specify the AREA option. Data is accepted
regardless of how modified-data-tags are set for fields in the defined area.
#string-var [,#string-var ]
specifies that data is to be mapped onto the string variable list as it is received
from the terminal in a left-to-right, top-to-bottom basis.
The data from the first field received from the terminal is stored in the first string
variable in the list, the next field data is stored in the second string variable, and so
on. The values accepted into the string variable list depend on how the WINDOW
options NOGLASS or NOPROTECT are specified for the windows being accepted.
ERROR integer-var
assigns the file-system error to the specified integer variable (integer-var).
When you specify the ERROR option, input-output operation errors are not retried.
Instead, they are returned in the error variable. Because the SeeView program
automatically handles input-output operation errors that occur during the execution
of an ACCEPT statement, use of the ERROR integer-var clause is considered
an advanced scripting technique.
FKEYWAIT
specifies that the SeeView program wait for a function key to be pressed before
performing the ACCEPT operation. During this wait interval, other SeeView
function key operations are not available.
Use the #FKEY intrinsics to determine the function key to be pressed. #FKEY
returns values 1 through 16 for function keys F1 through F16 and values 17
through 32 for shifted function keys SF1 through SF16. If they are pressed, the
#FKEY intrinsics #FKEYCOL, #FKEYDELETELINE, #FKEYINSERTLINE,
#FKEYLINE, #FKEYNEXTPAGE, #FKEYPREVPAGE, #FKEYRETURN,
#FKEYROLLDOWN, #FKEYROLLUP, #FKEYSNEXTPAGE, #FKEYSPREVPAGE,
#FKEYSRETURN, #FKEYSROLLDOWN, and #FKEYSROLLUP return values for
nonnumeric function keys. (For details, see String Intrinsics on page 304304.)
The FKEYWAIT option is referred to as a modal operation. The FKEYWAIT option
results in a wait state or mode. The FKEYWAIT option is not recommended if you
want to preserve the modeless, nonhierarchical interface that the standard
SeeShell provides.
The FKEYWAIT option is useful for implementing modal dialog mechanisms such
as dialog boxes and function-key-driven operations.
To maintain script context, use the WINDOW MENU option to associate the
desired screen-handling procedure with the input menu. You need not use the
modal FKEYWAIT option to maintain script context.
This example shows the FKEYWAIT option:
taskid
specifies an arithmetic expression as a valid taskid number. The cache
associated with this taskid is the cache that the ACCEPT statement applies to.
FIELDPERLINE
maps the data received from each field into a separate line of cache. This
provides a generalized means of processing the lines of text accepted from an
input area.
If you do not specify FIELDPERLINE, data received from the screen is mapped
column for column directly into the cache. For example, if data is from column
10 of the ACCEPT area, the data in the cache is blank-filled with nine blanks
and then the data. Fields that contain escape sequences are not mapped into
the cache. Data is offset in the cache relative to the area being accepted and
not relative to the data‟s absolute screen address.
PROTECTED
specifies that both protected and unprotected fields are to be read. PROTECTED
uses the T6500 terminal Read With Address All ESC ']' area sequence to accept
both PROTECTED and UNPROTECTED fields within the specified area.
Note. HPE recommends that the PROTECTED option be used only with the INTO
option. The PROTECTED option with an ACCEPT to a list of string variables is not
recommended because the PROTECTED option causes many extra fields to be
accepted. Storage is thus dependent on the fields generated by WINDOW options such
as GLASS, NOGLASS, and PROTECT.
TIMEOUT seconds
specifies the maximum number of seconds a script is to wait for the FKEYWAIT
operation to complete before SeeView cancels the ACCEPT and returns control to
the script. To determine if a timeout occurred, use the ERROR option and check if
the error variable has a value equal to 40. For example:
ACCEPT FKEYWAIT TIMEOUT 5 ERROR err;
This command returns a value of err=40 if a timeout occurred.
TRACE taskid
indicates that data received from the terminal is appended to the end of the cache
associated with taskid.
This option is similar to the INTO option except that each field received from the
screen is pushed to a separate cache line and is prefixed by the row column
screen location that the data came from. For example, if field DATA came from row
3 column 10, the cache line contains 003 010 DATA. Control characters are
translated to the ? character. The TRACE option is primarily for debugging.
taskid
specifies an arithmetic expression as a valid taskid number. The cache
associated with this taskid is the cache that the ACCEPT statement applies to.
WINDOW
specifies the screen area to be accepted.
WINDOW is the default and implies that the area to be accepted is defined by the
dimensions of the window or menu located at the current buffer address. When
you do not specify a window or menu at the current buffer address, the area to be
accepted is the default value of 1,1 for 80 wide by 24 high.
column
indicates the horizontal column location.
width
defines the width of the area.
height
defines the height of the area.
This example shows the AREA option:
AREA 1,1,5,3 includes fields from:
1,6 .. 1,80
2,6 .. 2,80
3,6 .. to end of screen.
Examples
This example reads the input data associated with the name, address, and phone
menu fields into the local string variables #name, #address, and #phone and then
inserts this input into an SQL table using the SQL conversational interface (SQLCI):
?MENU person
{-----------}
Name [John Doe ]<==?
Address [100 Main, Plaines, IL ]<==?
Phone [901-555-5555 ]<==?
*
?PROC GetPerson
{--------------}
LINE #menuline,#menucol; {Define menu area for accept.
VAR #name, #address, #phone; {Declare vars to accept into.
ACCEPT #name, #address, #phone; {Accept into string vars.
TASK sqlci;
BELOW; {Sqlci window below input menu
WINDOW sqlci, "INSERT INTO PERSON (*) VALUES (" &
"'" & #name & "',"
"'" & #address & "',"
"'" & #phone & "');"
?SECT GetPersonMain
This menu data is read in a single input operation with the ACCEPT statement in the
preceding example:
ALTER
The ALTER statement displays or alters various configuration parameter values.
[ ASCII8 ON | OFF ]
[ AUTOLOGOFF minutes ]
[ BOLDLINE25 ON | OFF ]
[ CACHEFILTER ON | OFF ]
[ COLORTABLE ON | OFF ]
[ DATATIMEOUT seconds ]
[ DEVTYPE PROCESS | TERM ]
[ DICTVOL vol-subvol ]
[ ECHOSUPPRESS ON | OFF ]
[ ERRORSTOP ON | OFF ]
[ FIFOPEER ON | OFF ]
[ FRAMEALPHA ON | OFF ]
[ FRAMEVIDEO ON | OFF ]
[ HIGHPINTASKS ON | OFF ]
[ INVERTGRAPH ON | OFF ]
[ IOTRACE ON | OFF ]
[ JOINTEXT ON | OFF ]
[ JOINWIDTH line-length ]
[ KEYSUPPRESS ON | OFF [ window-keys-syntax ] ]
VOLUME vol-subvol
specifies the current default vol-subvol for the SeeView program.
vol-subvol
specifies:
The default volume and subvolume assigned to user processes started
with the
TASK, OPEN, or RUN statements unless overridden by the VOLUME vol-
subvol option in the TASK, OPEN, or RUN statements.
The location of the data dictionary used by the GRAPH statement when
the GRAPH record.field name form of the GRAPH statement is used.
(See the GRAPH statement.) The data dictionary is generated with the
DDL compiler. Specify ALTER DICTVOL vol-subvol to separate the
dictionary specification from the default volume.
filename
specifies the name of the shell file.
CACHE taskid
specifies a symbolic variable name that indicates the cache containing a shell.
For additional information, see the
TASK statement.
section
invokes only the sections with this name. For more information, see Section 5:
SeeView Language Elements.
SAVEFILE filename
specifies the file name that the save-screen-to-savefile function key (SF11) saves
the current screen to. For more information, see SF11 documentation (save screen
to savefile).
TRACEFILE filename
specifies the file name of the current trace file. IOTRACE and RECVTRACE
information is written to this file. It is the same file specified with the Seedit utility
command SEND AUDIT FILENAME filename. The filename can be a string
expression.
HELPFILE filename
specifies the name of the EDIT file that contains the help text for the HELP
command. This Help file can be any EDIT file with keywords starting in column
three.
Keywords are any text that a user would like to obtain help for. To obtain help on
new features, the user would enter the statement HELP NEW FEATURES. The
Help file should contain the words NEW FEATURES starting in column three of a
KEYS window-keys-options
defines global function key actions to be applied to subsequent window statement
declarations. The syntax for this ALTER option is the same as for the KEYS option
of the WINDOW statement. For more information, see the WINDOW statement.
PRODUCTION string-exp
defines a global default production to be applied to subsequent WINDOW
statement declarations. For example:
ALTER PRODUCTION "CALL CutPaste"
causes subsequent WINDOW statements to be declared with a default production
equal to “CALL CutPaste”. When you press Return, that production is executed.
This action associates a general purpose production with all subsequent window
declarations in the current environment.
Use ALTER PRODUCTION “” to reset the global definition.
SHIFTPRODUCTION string-exp
defines a global default shift production to be applied to any subsequent WINDOW
statement declarations. For example:
ALTER SHIFTPRODUCTION "CALL ShiftHandler"
causes subsequent WINDOW statements to be declared with a shift production
equal to “CALL ShiftHandler”. When you press Shift-Return, that production is
executed. This action associates a general purpose production with subsequent
WINDOW declarations in the current environment.
Use ALTER SHIFTPRODUCTION “” to reset the global definition.
ASCII8 ON | OFF
performs a “setmode 23” set character size. The ON option sets the character size
to 8 bits. OFF sets the size to 7 bits. The default setting is OFF.
The ASCII8 ON option provides multinational language support for extended ASCII
as specified by ISO 8859/1. This option used in conjunction with the TRANSLATE
statement supports a variety of 8-bit character sets.
Each time ASCII8 is altered ON or OFF, a TRANSLATE INITIALIZE operation is
automatically performed.
AUTOLOGOFF minutes
causes the SeeView program to automatically log off when no function keys have
been pressed for the specified time interval. To enable this option, specify a
nonzero time in minutes. For additional information regarding logon and logoff, see
the GOODBYE and HELLO statements.
The default values is zero (0). If you do not specify the option, the feature is not
enabled.
BOLDLINE25 ON | OFF
specifies that line 25 messages, which are also stored in the free message cache,
are highlighted in reverse video (BOLDLINE25 ON).
The default is ON. If you do not specify the option, the feature is enabled. That is,
line 25 messages that are written to cache are highlighted with reverse video.
CACHEFILTER ON | OFF
specifies whether interprocess messages received by SeeView from user tasks
are filtered. CACHEFILTER ON filters out all illegal non-ASCII characters such as
communications and terminal control characters.
The default is ON, and it is the recommended setting.
COLORTABLE ON | OFF
specifies the PCT colortable for PCs running PC6530 revision C or higher. The
COLORTABLE ON option causes SeeView to automatically reload the PCT
colortable when SeeView goes through I/O recovery. The PCT colortable is
reloaded with the contents of the SeeShell global variable #ZZCOLORTABLE.
The default is OFF, but it is automatically turned on by the standard SeeShell
when SeeView is running from a PC with PC6530 revision C or higher.
DATATIMEOUT seconds
specifies the default timeout value in seconds assigned to user tasks declared
with the OPEN or
TASK statements.
A DATATIMEOUT occurs when the arrival rate between messages from a process
exceeds the specified number of seconds. DATATIMEOUT occurs only after data
has been received from a user task in response to a request for data from that
task. Timeouts provide a way to limit the amount of time the SeeView program and
the SeeView interpreter wait for operations such as
DICTVOL vol-subvol
specifies the location of the volume and subvolume of the DDL-generated data
dictionary used by the GRAPH statement. If you do not specify ALTER DICTVOL,
the default location for the data dictionary is the same as the ALTER VOLUME
volume and subvolume. By specifying the location of the DICTVOL, you can
separate the location of the data dictionary from the default volume.
ECHOSUPPRESS ON | OFF
specifies whether text entered on the sill of an assigned window is echoed at the
corresponding location of the prompt in the upper output portion at that same
window. ECHOSUPPRESS OFF is the default. It indicates that text entered on the
sill of a window is echoed.
ERRORSTOP ON | OFF
tells the SeeView interpreter to stop interpreting statements when a syntax or run-
time error occurs and displays the statement where the error occurred in the
largest free window on the Help page.
The default is ERRORSTOP ON. When you set ERRORSTOP OFF, an error does
not stop the interpreter, but causes the SeeView interpreter to skip to the next
section in the current script or shell file.
FRAMEALPHA ON | OFF
specifies whether window frames are drawn using alternate graphic characters
(FRAMEALPHA OFF) or drawn with standard ASCII characters such as |_|
(FRAMEALPHA ON).
FRAMEALPHA ON permits the SeeView program to work with some T65xx
terminal emulators that do not support alternate character sets; for example, the
T6526 terminal.
The default is FRAMEALPHA OFF for all terminal types except the T6526 terminal.
This option is set by the standard SeeShell.
FRAMEVIDEO ON | OFF
specifies whether window frames are drawn using video attributes (FRAMEVIDEO
ON) instead of alternate graphic or alpha characters (FRAMEVIDEO OFF). ALTER
FRAMEVIDEO ON allows the SeeView program to work with any T65xx terminal
emulators that do not support alternate character data. For information about how
to define the video attributes of window components such as the window heading,
body, and footing, see the FRAMEVIDEO statement.
The default is FRAMEVIDEO OFF.
HIGHPINTASKS ON | OFF
specifies whether TASK, RUN, and OPEN statements attempt by default to launch
processes as high or low PIN processes. The term PIN means process
identification number. A high PIN is a process that runs with a PIN greater than
255.
ON implies TASK, RUN, and OPEN statements attempt to create processes that
run as high PINs. When this option is on, processes are started using the Guardian
procedure PROCESS_CREATE_.
OFF implies TASK, RUN, and OPEN statements create low PIN processes. When
this option is off, processes are started using the Guardian procedure
NEWPROCESS.
The intrinsic #TASKPROC returns the name of the procedure that was used to
launch the process via the TASK, OPEN, or RUN statements. This intrinsic is used
INVERTGRAPH ON | OFF
specifies that histogram information presented by the GRAPH statement is
presented in inverted order. INVERTGRAPH ON means that the first through last
records graphed appear inverted in right-to-left order rather than the normal left-to-
right order.
The default is INVERTGRAPH OFF.
IOTRACE ON | OFF
indicates whether all terminal input and output should be traced to the file specified
with ALTER TRACEFILE filename.
ALTER IOTRACE ON causes terminal IO to be traced to this file. IOTRACE OFF is
the default. Use this option for debugging purposes only.
JOINTEXT ON | OFF
specifies that text in the adjacent window is not erased on a break or join window
operation (JOINTEXT ON). This option is useful for converting serial data into
multicolumn tabular format.
The default is JOINTEXT OFF.
JOINWIDTH line-length
specifies the join width that the window editor uses. The default width is line-
length equals zero and means that the join width is the width of the current
window.
line-length
If line-length is set greater than zero, the join width is the smaller of either
the current window width or line-length. If line-length is less than zero,
the join width is the window width reduced by that negative amount. In other
words, a negative line-length defines the size of the right margin.
LOGONSTRONG ON | OFF
specifies whether hello logon authentication is performed using the VERIFYUSER
or USER_AUTHENTICATE_ system procedure call.
LOOP ON | OFF
indicates whether the shell file specified with the SHELL option is repeatedly
executed by the SeeView interpreter. LOOP ON indicates that the shell file is
repeatedly executed and implies that at the completion of each loop a delay of
SECTIONDELAY seconds occurs before the shell file is reexecuted. LOOP OFF
indicates that the shell file is not repeatedly executed.
The default is LOOP OFF.
MENUSTATUS ON | OFF
specifies whether taskids containing menu data are displayed. (For more
information, see the STATUS statement.)
The default is OFF.
MSGTRACE ON | OFF
indicates that messages pushed to the free window message cache are also
written to the file defined by the ALTER TRACEFILE option.
MULTIWINDOWS ON | OFF
specifies whether the window below or to the right of the window that is broken
with a break-window operation (function key F9) is a free window
(MULTIWINDOWS OFF) or multiple windows assigned to the same taskid
(MULTIWINDOWS ON).
The default, MULTIWINDOWS OFF, causes a break-window operation to create a
free window.
NODATATIMEOUT seconds
specifies the NODATATIMEOUT value in seconds assigned to user tasks
declared with the OPEN or
TASK statements. The default value is 60 seconds.
A NODATATIMEOUT occurs when the time for the first message received from a
process exceeds the specified number of seconds. The NODATATIMEOUT option
enables you to specify how long you are willing to wait before any response is
received from a user task after a request for output from that task.
Use the NODATATIMEOUT option to limit the amount of time the SeeView
program and the SeeView interpreter wait for operations such as
WRITE, READ, and WINDOW to complete. This option also prevents external
deadlocks from affecting the SeeView program.
PRIORITY priority
specifies the execution priority of the SeeView process.
The integer value specified by ALTER PRIORITY priority causes the SeeView
program to alter its own execution priority to be equal to the value specified. Users
tasks declared with a
TASK or OPEN statement have a process priority of one less than the current
execution priority of the SeeView process (unless a $CMON process specifies a
different execution priority). For additional information regarding user task
priorities, see the TASK statement.
PROCTRACE ON | OFF
specifies whether a line-25 message is displayed each time a procedure is
executed.
ON indicates that each time the SeeView interpreter executes a procedure, that
procedure name is displayed on line 25. The default is OFF.
QUEUE ON | OFF
specifies the value for the QUEUE attribute option for user tasks declared with the
OPEN or
TASK statements.
QUEUE OFF, the default, indicates that the SeeView program automatically
replies to all simple write messages from the task.
QUEUE ON indicates that the SeeView program does not automatically reply to
any messages, including simple writes, from the specified task.
Typically, the only time you need to specify QUEUE ON is to assert programmatic
synchronization in a script that preforms complex interleaving of
WRITE and READ statements between multiple processes. Communication
synchronization in a script for a single process is ensured unless WRITE and
READ statements are interleaved with one or more
WAIT statements.
RECVTRACE ON | OFF
indicates whether all $RECEIVE reads and replies should be traced to the file
specified with ALTER TRACEFILE filename.
ALTER RECVTRACE ON causes this message traffic to be traced to the trace file.
RECVTRACE OFF is the default. Use this option for debugging purposes only.
REFRESH seconds
specifies the interval in seconds for windows to be automatically updated
(refreshed) with messages received in the user-task message cache.
The REFRESH algorithm adapts to both terminal user function key operations
and external user-task events. Making the algorithm adaptive minimizes read
cancellation and making the terminal appear fairly full duplex. The algorithm
also eliminates redundant checking of the user cache when it is not changing
and saves CPU cycles.
Top-down user-controlled paging of window text is the default for all windows.
Normally, window text is not automatically paged or scrolled ahead. This can
be specified with the WINDOW CACHE EOFSEEK or EOFONLY options.
When the REFRESH operation is enabled, and the function keys F1 and F2
are used to switch terminal pages, all REFRESH I/O operations are
automatically piggybacked onto the same input-output operation as the select
terminal page operation. This process ensures that what you see reflects the
current state of the message cache and eliminates a subsequent update a few
seconds later. If this piggyback operation is not performed, the adaptive
refresh algorithm determines that the screen data is out of sync with the
message cache and that the program has to do another update a few seconds
later.
SECTIONDELAY seconds
specifies the number of seconds that the SeeView program waits between
sections when executing the current shell. During this pause, the section name just
executed appears on line 25 of the terminal. Once the delay is completed, the next
sequential section in the shell file is executed.
The default is SECTIONDELAY 1, but the standard SeeShell sets
SECTIONDELAY to 0.
SECTIONMSG ON | OFF
specifies whether a timer countdown message is displayed while the SeeView
program is waiting for the time interval defined by SECTIONDELAY seconds to
process the next sequential section in the shell file.
The default is OFF.
SETMODE110 ON | OFF
causes an immediate SETMODE 110 ON|OFF operation. Setting SETMODE110
permits the logical editing of alternate character data.
OFF indicates that alternate characters are delimited with shift-out and shift-in
ASCII control characters. SETMODE110 ON indicates that alternate characters
are delimited with the high-order bit of each character byte set on.
The default is SETMODE110 OFF.
SILLERASE ON | OFF
specifies whether text on a window sill from the cursor position and to the right of
the cursor is erased when you press Return. Some users find it useful to retain the
text to the right of the cursor on a window sill. SILLERASE OFF permits this.
The default is ON.
SILLSCROLL ON | OFF
specifies the behavior of function keys F3 and F4. SILLSCROLL ON allows these
keys to provide scrolling through the command history for a taskid.
SILLSCROLL OFF specifies that F3 and F4 perform window text scrolling.
Because window text scrolling is possible on most keyboards with the Roll-
Up/Down keys on the right-hand side of the keyboard, using F3 and F4 to scroll
text is redundant.
The default depends on the terminal type. For additional information, see the
HISTORY statement.
STMTTRACE ON | OFF
specifies whether statement tracing is performed. In the STMTTRACE ON state,
each time a statement is executed, that line of source code appears in the free
window cache.
Traces are annotated with elapsed-time and CPU statistics to allow in-depth
analysis of script performance.
This option is used mainly for program debugging purposes. The default is OFF.
TESTLL ON | OFF
specifies whether extended memory-linked list diagnostics are enabled. This
option is for debugging purposes.
The default, TESTLL OFF, is the recommended setting.
VERTICALBREAK ON | OFF
specifies whether a symmetric break window operation is to break the window into
two equal sized horizontal windows (VERTICALBREAK ON) or two vertical
windows (VERTICALBREAK OFF).
The default is ON.
WORDTAB ON | OFF
specifies whether the tab backward and forward function keys (F15 and F16)
operate on a column basis, enabled by selecting WORDTAB OFF, or on a wordtab
basis, by selecting WORDTAB ON.
Tab backward or forward is always a column tab when the cursor is on a window
sill.
The default is ON.
statement
specifies any SeeView statement. The term compound-statement refers to the
block of statements delimited by the BEGIN .. END; delimiters. A compound
statement can appear anywhere a simple statement can appear. Consider:
IF condition THEN statement
It also means:
IF condition THEN compound-statement
Considerations
You can use nested compound statements.
Example
This example displays nested compound statements:
BELL
The BELL statement sounds the audible alarm on the terminal device associated with
the SeeView program.
BELL
Example
This example demonstrates how to use the BELL statement:
BELOW
The BELOW statement sets the current buffer address to the screen position just
below the last menu referenced. Use the BELOW statement to position a window or
menu directly below the last referenced menu. This statement provides a convenient
way of specifying the screen buffer address that is just below the last menu, rather
than having to calculate that address.
BELOW
Considerations
The BELOW statement has the same meaning as:
LINE #MenuLine + #MenuHeight, #MenuCol;
Example
This example demonstrates how to implement the BELOW statement:
?MENU Devtypes
Devices <== BELOW; WINDOW [] MENU CACHE/Disc/ UNTIL /*/
Disc <== CALL Listdev(#menutext)
Printer <== CALL Listdev(#menutext)
Tape <== CALL Listdev(#menutext)
*
?SECT SectExample
WINDOW Devtypes MENU CACHE/Devices/ FOR 1 SIZE 13 HEAD "System";
BESIDE
Considerations
The BESIDE statement has the same meaning as:
LINE #MenuLine, #MenuCol + #MenuWidth;
Example
This example demonstrates how to implement the BESIDE statement:
?MENU Devtypes
Devices <== BESIDE; WINDOW [] MENU CACHE/Disc/ UNTIL /*/
Disc <== CALL Listdev(#menutext)
Printer <== CALL Listdev(#menutext)
Tape <== CALL Listdev(#menutext)
*
?SECT SectExample
WINDOW Devtypes MENU CACHE/Devices/ FOR 1 SIZE 13 HEAD "System";
BREAK
The BREAK statement sends a break message to the specified process. Use the
BREAK statement to send a system break message to the specified user taskid. The
user task specified must be a process that the SeeView program has opened. (It
cannot be just any process.) Use a taskid expression, process name, or CPU and
process identification number to indicate which process is to receive the break
message.
BREAK [ taskid-exp ]
[ \ node . [ $ process-name ] ]
taskid-exp
specifies an integer taskid expression that indicates the taskid number of the
process to receive the break message.
\node
specifies the network node name of the process to receive the break message.
$process-name
specifies the process name of the process to receive the break message.
cpu,pin
specifies the CPU number and process identification number of the process to
receive the break message.
Considerations
If you enter the BREAK statement from a window without specifying a process, the
process currently associated with the window receives a BREAK message.
Some processes (TACL, for example) require that the device type of the SeeView
process be a terminal in order to receive a break message. You can specify this device
type with the DEVTYPE option for the
TASK and OPEN statements.
Example
This example demonstrates how to use the various options of the BREAK statements:
CALL
The CALL statement executes a specified SeeView procedure. CALL statements can
be executed from menu productions, procedures, sills, or sections. The procedure-
name is executed, and optional string or integer parameters can be passed to the
called procedure.
parm
specifies optional parameter string or integer expressions to be passed to the
called procedure. Separate parameters with commas and surround them with
parentheses.
Use the PARM statement to declare parameter variables in a procedure. For more
information, see the PARM statement.
Example
This example shows the CALL statement:
?MENU Devs
Devices <== BELOW; WINDOW [] MENU CACHE/Disc/ UNTIL /*/
Disc <== CALL Listdev(#menutext)
Tape <== CALL Listdev(#menutext)
Printer <== CALL Listdev(#menutext)
*
?PROC Listdev ( #DeviceType ) { Declare proc "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 SectExample
WINDOW Devs MENU CACHE/Devices/ HEAD "" FOR 1 SIZE 13;
vst9-178.vsd
CI
The CI statement allows SeeView to execute in command interpreter (CI) mode. This
mode allows SeeView scripts containing PROMPT statements to provide a command
interpreter interface.
shell-filename
optionally specifies the shell file name to be used when SeeView runs. If no shell
filename is specified, the default CI-mode shell named SEEiSHEL is used. When a
fully qualified shell file name is specified, the CI statement also defines the default
volume and subvolume of disk files accessed by SeeView. You can also use the
ALTER statement to individually alter file settings. Attributes affected by the CI
statement are SHELL, DICTIONARY, SAVEFILE, and the default VOLUME.
section-name
specifies that only a particular section in the shell-filename is invoked when
the shell is invoked. See also ALTER SHELL option.
Considerations
When SeeView runs in CI mode, scripts containing PROMPT statements allow
SeeView to behave as a command interpreter.
When the CI statement appears as the first statement in the startup message of a
TACL SeeView run statement, SeeView is run in SERVERMODE 3.
Examples
These examples show how to use the CI statement:
TACL 1 > RUN SeeView CI
TACL 2 > RUN SeeView CI $Data.subvol.MyScript
CLEAR
The CLEAR statement clears data either from an entire page or, if entered from a
window, only from the window area.
CLEAR
Considerations
If you use the CLEAR statement to clear a page, all windows on that terminal page,
including edit-mode windows, are deleted. The processes associated with the window
still exist, and their interprocess communication context is unaffected.
If you use the CLEAR statement to clear the contents of a window and the data in the
window is also in the cache, the data still remains in the cache.
line
specifies an area to be cleared, in the range 1 through 24.
column
specifies an area to be cleared, in the range 1 through 80.
width
specifies an area to be cleared, in the range 1 through 80.
height
specifies an area to be cleared, in the range 1 through 24.
Example
This example shows the CLEARW statement displaying various options:
CURSOR
The CURSOR statement specifies where the cursor should be placed on the current
terminal output page, defined by the PAGE or SETPAGE statements.
The upper-left corner of the screen is location 1,1. The lower-right corner is 24, 80.
line-exp
specifies the vertical line number location. Absolute line numbers range from 1
through 24, top to bottom of the screen.
Example
This example shows the CURSOR statement displaying various options:
DECLARE
The DECLARE statement declares string and integer variables. The DECLARE
statement and the VARIABLE statement are equivalent.
variable
specifies the symbolic variable name of a string or integer variable. If you prefix
variable with a pound sign (#), it represents a string variable. Otherwise, it
represents an integer variable. String variables can contain up to 132 characters
and have an implicit length associated with them. Integer variables represent 16-bit
signed integers.
A variable name can be any combination of alphanumeric characters up to 16
characters in length. Variables can be initialized when declared and can reference
intrinsics or other previously declared variables.
The scope of string and integer variables is global when declared in a ?SECTION
and local when declared in a ?PROCEDURE.
initialization-exp
specifies an optional initialization expression used to initialize the value of the
declared variable.
The initialization-exp can be either an integer expression such as
(5+60/10) or a string expression such as “THE TIME IS” & #TIME.
You can initialize string variables to either a string or integer value. You must
initialize integer variables to an integer value.
String variables declared with no initialization-exp have an initial value
equal to the null string "". Integer variables declared with no initialization-
exp have an initial value equal to minus one (-1).
DELAY
The DELAY statement causes the terminal to delay the processing of its command
string for a specified number of seconds.
DELAY seconds
seconds
specifies the delay time in seconds.
Note. The DELAY statement delays only the terminal and not the SeeView program
itself.
Considerations
The
WAIT statement is preferable to the DELAY statement in all cases except special
terminal testing.
Example
This example demonstrates how to use the DELAY statement:
VAR pg:=0;
WHILE (pg:=pg+1) < 7 DO BEGIN {For pages 1->6:
PAGE pg; {Display page "page"
DELAY 2; {wait 2 secs between pages
END;
DELETE
The DELETE statement deletes all lines of text contained in the cache memory
associated with the specified task.
DELETE cache-taskid !
!
indicates that you want to perform the delete. Because the DELETE statement
completely destroys all data stored for a given task or set of tasks, the exclamation
point (!) is required.
Note. The DELETE statement does not change a task's operational status. If the task
was running, it will still be running.
Example
This example shows how you can use the DELETE statement to empty a cache so
that it can be used to programmatically generate a dynamic menu:
?MENU FileInfo
TASK fup;
WRITE fup,"info " & #subvol & ".*";
FOR 2 DO READ fup;{ skip over heading
DELETE FileInfo !;{ empty FileInfo cache
TASK fup COPY FileInfo;
LINE 4;
WINDOW FileInfo { Display FileInfo Menu
MENU
"CALL ShowInfoDetail(#TAKE #MENUTEXT)"
CACHE SIZE 13,24;
ALLFIELDS | ALL
FREEONLY | FREE
PROTECTONLY | PROTECT
VIDEOTEMP video-and-field-attributes
CLEAR
clears the indicated fields to spaces. For example:
DISPLAY CLEAR FIELD 0 FOR 3
clears the first three unprotected, or free, fields in the window.
DISPLAY CLEAR [FREE]; Clears all unprotected fields in the window
DISPLAY CLEAR ALL; Clears unprotected and protected fields
DISPLAY CLEAR PROTECT; Clears only protected fields in the window
str-exp-list
displays a comma-separated list of string expressions in the fields associated with
the window located at the current buffer address. Each string expression is
automatically mapped to the corresponding window field on a left-to-right, top-to-
bottom basis. For example:
Use the FIELD, FOR, FREE, PROTECT, and ALL options to control which fields
are updated.
CACHE index
specifies the ordinal record index in cache where the display is to start. If you
do not specify CACHE index, index zero is implied.
Cache indexes 0, 1, ..., correspond to the first, second, ... records in cache,
and
-1, -2, ..., correspond to the last, second from last, ..., records in cache.
FOR number-of-fields
indicates the number of fields to display. If you do not specify FOR, all data
elements contained in the str-exp-list or from taskid appear. For example:
?MENU PersonData
John
Smith
500 West Main
Chicago
IL
?SECT Main
DISPLAY FROM PersonData CACHE 2 FOR 3;
First[]Last[]
Street[500 West Main]
City[Chicago]State[IL]
ALLFIELDS | ALL
indicates that both protected and unprotected (free) fields are accessed with the
DISPLAY statement. Normally, only unprotected (free) fields are accessed. When
FREEONLY | FREE
indicates that only unprotected, or free, fields are accessed with the DISPLAY
statement. FREE is the default. The FIELD and FOR options apply only to the
unprotected free fields.
PROTECTONLY | PROTECT
indicates that only protected fields are accessed with the DISPLAY statement. The
FIELD and FOR options apply only to protected fields.
VIDEOTEMP video-and-field-attributes
indicates that the video and field attributes for the specified fields are temporarily
set to the specified video-and-field-attributes. For a list of allowable
attributes, see the FIELD option of the WINDOW statement.
The temporary attributes are reset to the default attributes the next time the field is
referenced with the DISPLAY statement.
To restore specified field attributes to their original default values, use the
VIDEOTEMP( ) option of the DISPLAY statement.
Example
This example shows how you can use the DISPLAY statement:
Example:
?PROC init;
{---------}
{ initialize matrix to values from 0 .. (rows*cols-1)
{---------------------------------------------------}
PARM rows, cols;
VAR i,v; { note i, v initially = -1
FOR rows DO BEGIN
FOR cols DO BEGIN { value "v" into field i
DISPLAY (v:=v+1) FIELD (i:=i+1) FOR 1;
END;
DISPLAY CLEAR FIELD (i:=i+1) FOR 1; { clr last fld
END;
?PROC accept (rows, cols)
{-----------------------}
{ Accept data from matrix and add all "cols" for each row.
{ Display result in the result column at the end of each row.
{------------------------------------------------------------}
PARM rows, cols;
VAR #s,sum,row;
DELETE data!; { clear out old data
ACCEPT INTO data FIELDPERLINE; { accept numbers from screen
FOR rows DO BEGIN { sum them up for each row
row := row+1;
sum := 0;
FOR cols DO BEGIN
POP #s FROM data;
IF #NUMERIC #s THEN sum := sum+#s;
END;
DISPLAY (sum) FIELD (row)*(cols+1)+cols VIDEO(R);
POP #s FROM data;
END;
?PROC copy
{---------}
{ This proc copies data in window to MyFile.
{------------------------------------------}
DELETE data!;
ACCEPT INTO data PROTECTED; { accept all fields from window
SAVE MyFile!, data; { MyFile contents are below.
?SECT main
{---------}
{ 0 1 2 3 4 5 6 = 21
{ 7 8 9 10 11 12 13 = 70
{ 14 15 16 17 18 19 20 = 119
{ 21 22 23 24 25 26 27 = 168
CALL ShowMatrix( 8, 7 );
This output is from the previous program after function keys F5-Init and F7-Add are
pressed:
vst9-188.vsd
DO
The DO statement performs iteration until the numeric value of an expression is
nonzero.
statement
represents the SeeView statement that is to be reiteratively performed.
You can use a BEGIN term, followed by multiple statements and an END term, to
delimit a compound statement for execution. Nested statements are allowed.
UNTIL expression
specifies the expression that is to be evaluated after each iteration to determine
whether another iteration is to be performed: Reiterate statement if
expression is zero. Stop looping if expression is nonzero.
Example
This example shows a DO statement that iterates a compound statement:
?MENU systems
?PROC ShowNodes
{--------------}
{ This proc loads the "systems" menu
{ with network node numbers and names.
{------------------------------------}
VAR #s, #sysno;
TASK netmon;
DOWN
The DOWN statement moves the buffer address down a row relative to the current
buffer address.
expression
provides for moves greater than one.
char
specifies a single character that you can use to smear expression times in the
indicated direction. Smear means to use the specified char to mark all locations
moved through by the move operation. For example:
RIGHT:3:# DOWN:3:# LEFT:3:# UP:3:#
This example draws a box:
###
# #
###
See also the UP, LEFT, and RIGHT statements.
Example
This example demonstrates how to use the DOWN statement:
END
Example
This example displays how to use the END statement:
EXECUTE
The EXECUTE statement permits dynamic creation and execution of SeeView
statements.
string-exp
specifies one or more SeeView statements to be executed.
CACHE taskid
designates the taskid of the cache that is to be invoked or executed.
Considerations
The EXECUTE statement permits dynamic creation and execution of SeeView
statements. This enables you to use variable information contained in string and
integer variables to build SeeView statements.
Examples
1. This example of the EXECUTE statement finds a specified task and displays a
window on that task:
TASK pup;
CALL ShowTaskPage("pup");
?PROC ShowTaskPage { #taskname }
{------------------------------}
?MENU rules
{--------}
ADD= CALL AddRecord ("fup")
DELETE= CALL DownDevice("pup")
UPDATE= CALL UpdateRec ("sqlci")
?SECT main
{---------}
FLUSH
The FLUSH statement forces compiled screen data to be displayed immediately.
Screen output data is normally buffered until the end of compilation or is automatically
flushed if the buffer is full. By causing immediate display of data, the FLUSH statement
provides a means of controlling when buffer output occurs.
FLUSH
Example
This example shows how to use the FLUSH statement.
FOR
The FOR statement performs iteration on a statement.
expression
specifies any expression that yields an integer value. The expression indicates
the number of times statement is to be iterated. The expression is evaluated
only once to determine the number of iterations to perform, and it must be greater
than or equal to one.
Considerations
You can use nested FOR statements.
Examples
The DrawWindowsOn procedure uses nested FOR statements to draw windows on a
list of task names contained in the parameter string named #tasklist.
?SECT main
{---------}
TASK ci:=comint; { if not declared, proc declares
CALL
DrawWindowsOn("tacl ci pup cup scf cmi",3,2);
?PROC ChangeCache(Cacheid,#target,#newtext)
{-----------------------------------------}
PARM Cacheid { taskid of cache to scan
,#target { target text to change
,#newtext { text to replace target
;
VAR #s { scratch string var
,#before { text before target
,#after { text after target
, i { scratch integer var
, r { record no in cache
;
WITH Cacheid; { to use #taskcachelines
IF NOT #TASKCACHELINES THEN
RETURN; { nothing to scan for
FOR #TASKCACHELINES DO
BEGIN { read each line in cache
READ Cacheid CACHE (r:=r+1),#s;
SCAN #s UNTIL { search for target
#target->i;
IF i THEN { target found
BEGIN { figure text before/after
#before:="";{ text in #s before target
#after :="";{ text in #s after target
IF i>1 THEN { there is text before
#before:=#s[1:i-1];
IF (i+#SIZE #target) < (#SIZE #s) THEN
#after := #s[i+#SIZE #target:132];
#s:= #before & #newtext & #after;
{ #s updated, now update record in cache
WRITE Cacheid CACHE r UPDATE,#s;
END;
END;
Note. The preceding example is for demonstration purposes only to illustrate use of
nested FOR statements. This example performs a case-sensitive scan for the #target.
The
SEARCH statement example shows a more efficient non-case-sensitive change
mechanism.
FRAMEVIDEO
The FRAMEVIDEO statement defines the video attributes for window frames when the
ALTER option FRAMEVIDEO is ON. FRAMEVIDEO and FV are synonyms.
When the ALTER option FRAMEVIDEO is ON, the SeeView program operates with
any 6500 terminal emulator, including those that do not support the T6530 terminal
alternate graphics character data set. See the ALTER FRAMEVIDEO option.
[ MENUHEAD ]
[ MENUBODY ]
[ MENUFOOT ]
[ EDITHEAD ]
[ EDITBODY ]
HEAD
specifies the video attributes for window headings. This portion of the window is
referred to as HEADING in the WINDOW statement.
video
specifies any of the video attribute syntax defined in the
VIDEO statement. Thus video can be either video attribute keywords
enclosed in parentheses such as (Reverse, Blink, Dim, Underline), or video
attribute numeric values enclosed in square brackets such as [4+1+16] which
is equivalent to the keywords from (Reverse Dim Underline).
BODY
specifies the video attributes for window bodies. The body is the portion of the
window referred to as the GLASS area of the window in the WINDOW statement.
FOOT
specifies the video attributes for window footings that have a sill. This portion of the
window is referred to as the SILL in the WINDOW statement.
FOOTNOSILL
specifies the video attributes for window footings that have no sill. This portion of
the window is referred to as the SILL in the WINDOW statement.
MENUHEAD
specifies the video attributes for window headings that are associated with menu
windows. This portion of the window is referred to as the HEADING in the
WINDOW statement.
MENUFOOT
specifies the video attributes for window footings associated with menu windows.
This portion of a window is referred to as the SILL area of a window in the
WINDOW statement.
EDITHEAD
specifies the video attributes for window headings associated with edit-mode
windows. This portion of the window is referred to as the HEADING in the
WINDOW statement.
EDITBODY
specifies the video attributes for window bodies that are associated with edit-mode
windows. This portion of a window is referred to as the GLASS area of a window in
the WINDOW statement. When a window goes from normal mode to edit mode,
the video attributes of the window body automatically change from BODY video
to EDITBODY video.
Example
This FRAMEVIDEO statement displays window headings in reverse video, the window
body in normal video, and window footings in reverse underline video:
FV HEAD(R) BODY() FOOT(R U).
This example shows how to use the FRAMEVIDEO statement.
Calls the SeeShell procedure SEECOLOR to set the colors for PCT
Defines FRAMEVIDEO attributes for video frames and sets FRAMEVIDEO ON
Initiates recovery so the SeeView program repaints all windows and menus
Example 9-1. Sample SeeView Program
CALL seecolor;
GOODBYE
The GOODBYE statement logs you off from the SeeView program. All function key
operations are disallowed in the logoff state except the Return key, which you use to
log on. (For more information on logging on, see the HELLO statement.)
When you are logged off, the SeeView program continues to maintain user context,
communicate with user tasks, process user task messages, and cache the user task
messages in a normal manner.
The GOODBYE statement does not execute if any conditions exist that would prevent
you from logging back on, such as:
!
indicates that you want to log off regardless of whether any windows are in edit
mode. Specifying the exclamation mark indicates that you do not care about
saving changes made to edit-mode windows.
You can follow a GOODBYE statement with other SeeView statements, with the
exception of CLEAR, CLEARW, PAGE, and SETPAGE. These statements cause
a run-time error if executed when the SeeView program is in a logged-off state.
This example executes properly:
Continued execution of statements allows you to define the rules for logoff. Thus,
the command GOODBYE; RUN COMINT allows you not only to safely secure your
SeeView environment (and all tasks running under it) but also to optionally give up
the terminal for general command interpreter use (for example, COMINT or TACL).
Exiting the command interpreter returns control to the SeeView program, which
you can then log on to with the HELLO statement.
The configured value of the ALTER PRIVATE [ ON | OFF ] option at logoff time
controls whether SeeView logon access is restricted to a specific user ID
(PRIVATE ON, which is the default) or whether access is open to any user with a
valid user ID (PRIVATE OFF). If you set ALTER PRIVATE ON, logon by the super
ID is permitted. For logon considerations, see the HELLO statement.
You can use the ALTER AUTOLOGOFF option to automatically log off after a
specified period of operator inactivity. See the ALTER AUTOLOGOFF option.
GRAPH
The GRAPH statement draws a histogram of the specified numeric data. The FILE,
TASK, or RECORD option accesses various data sources.
FILE filename
specifies that data in a disk data file containing ASCII or data defined by a data
dictionary is to be graphed.
TASK taskid
specifies that messages from a taskid declared with the TASK statement are to
be graphed. For example, use the GRAPH TASK taskid statement as follows:
RECORD record.field
indicates that the data to be plotted is specified by the data definition contained in
the DDL-generated data dictionary in the current default subvolume.
record.field specifies a DDL-defined record.field, such as
YEARLY.REVENUES. You do not have to say GRAPH RECORD
YEARLY.REVENUES but GRAPH YEARLY.REVENUES instead. (The parser
recognizes that you are referring to a record.field without the keyword
RECORD.)
If the RECORD specification appears, without TASK or FILE, the data represented
by record.field is from the file identified by the DDL record description.
If the RECORD specification appears with a TASK or FILE specification, the data
comes from the TASK or FILE, but the field data type and offset information
contained in the DDL data dictionary is used to interpret the records from the
indicated TASK or FILE.
You can also subscript a field name with an index (for example, x.y.z[ i ]) even
when the field is not declared with a DDL occurs clause.
When you issue a GRAPH TASK taskid or GRAPH FILE filename statement
without an additional RECORD specification, the format of each record or
message is assumed to be free-form ASCII numeric, and the first number in each
record is graphed.
AT Xexp , Yexp
indicates where on the page to plot the graph. You can use other SeeView
statements, such as LINE, to provide positioning.
CACHE index
reads graph data from the cache associated with the taskid rather than actually
reading from the task in real time.
index
specifies the beginning ordinal record index in the cache. CACHE indexes 0, 1,
2, ..., correspond to the first, second, third, ..., records in cache, and CACHE
indexes -1, -2, -3, ..., correspond to the last, second from last, third from last,...,
records in cache.
FOOT string-exp
defines additional optional text at the base of the graph. This option is frequently
used to place additional information at the base of a graph. The number of
characters in string-exp should not exceed the width of the graph.
GRID interval-exp
indicates the grid pattern interval in terms of the number of vertical character
positions.
The default is GRID 1, which specifies a grid for every line. GRID 0 suppresses the
grid altogether. GRID 3 specifies a grid on every third vertical increment. These
examples illustrate GRAPH statements entered from free windows.
HEADING string-exp
defines an optional text heading for the graph. You can abbreviate the HEADING
option as HEAD.
HISTO number
selects the type of built-in graphic character to use for the current graph. There are
six different built-in graphic characters for a T6530. You can use HISTO values 1 ..
6 to select these different character sets. If you use a value outside the range 1..6,
the graphing character set is selected based on modulo 6 of number.
HISTOALT 6-altchars
defines the ASCII characters used to form the graphing segments. For example,
HISTOALT "123456" defines the six alternate characters used to draw graph
segments.
INVERT
causes data to appear in reverse order. Thus, the first record would appear in the
rightmost position in the graph instead of the leftmost position.
Note. The quotation marks (“) around the left and right brackets ([ and ]) indicate
that the brackets must be entered as part of the syntax. Do not confuse these
brackets in quotation marks with syntax notation brackets. Normal brackets indicate
options. These brackets are entered as part of the syntax.
MASK mask-syntax
defines histogram vector placement. A mask consists of a series of mark-and-
space format rules for displaying the vertical elements of a histogram. For
example, MASK (4M,2S) indicates that each group of four vertical histogram data
points should be spaced two columns apart.
OVERLAY
specifies that the graph is drawn with no frame or grid. Use this option to
superimpose multiple graphs in the same area.
min
specifies the minimum positive integer value that can be represented in 31 bits.
MIN
specifies the minimum value for all elements of the graphed data.
max
specifies the maximum positive integer value that can be represented in 31
bits.
MAX
specifies the maximum value for all elements of the graphed data.
Wexp
specifies an integer expression indicating the width of the graph, such as SIZE
40,12. Valid values for Wexp range from 5..80. Width specifies the number of
histogram elements to be graphed. For example, a width of 80 graphs more
elements than a width of 5.
MAX
specifies the maximum allowable width or height possible. MAX is an easy way
of making a graph as large as possible.
Hexp
specifies an integer expression indicating the height of the graph. Valid values
for Hexp range from 3 through 24.
?PROC GraphCpus(sysno,#cpulist)
{-----------------------------}
{ Graph cpu busy for cpu numbers
{ contained in #cpulist for sysno
{--------------------------------}
PARM sysno { system number of CPUs in cpulist
,#cpulist { list of cpu numbers to graph
;
VAR count:=0 { number of CPUs in #cpulist
, cpuno { current cpu number
,#s { scratch string
;
#s:=#cpulist; { count number of CPUs in list
WHILE #TRIM #s<>"" DO count:=count+1;
?SECT main
{---------}
ALTER DICTVOL $WORK.NSSDB;
VST905
HELLO
The HELLO statement logs on to SeeView.
group . user
specifies the accessor ID that you use to log on to SeeView.
A two-step invisible-password hello logon occurs from a window if you do not
supply the [ , password ] portion of the HELLO statement. The window is
reformatted using the WINDOW…BLANKSILL attribute. When you enter the
password and press Return, the window is restored to its original state.
password
designates the password you must use, if indicated, to log on to SeeView.
If the password includes control characters, you can use the tilde character (~) to
delimit the control character. (Pressing the CTRL key has no effect when a 6500-
series terminal is in block mode.) For example, ~NOP is equivalent to control-
NOP. If password is included in a SeeView script file, tilde characters are used to
delimit control characters.
Note. Change the accessor ID of the SeeView process only after careful planning.
Changing the accessor ID of the SeeView process does not change the accessor ID of
the processes with which the SeeView program communicates. However, by doing so,
you assume all responsibility as to whether logged-on processes should be logged off or
stopped, as well as whether the user context in cache should be deleted using DELETE
statements.
Example
This example shows the HELLO statement and how to use the tilde to delimit control
characters.
HELP
The HELP statement provides online information about SeeView commands and the
SeeView program. To request help from a free window at any time, enter HELP and
HELP [ command ]
[ string-exp ]
[ ALL ]
[ NEW [ FEATURES ] ]
[ NEW USER ]
command
displays a detailed description of the designated SeeView statement command.
string-exp
refers to any string operator or intrinsic as defined in
ALL
lists all of the SeeView statement commands and function keys. It has the same
function as pressing F14.
vst906
NEW [ FEATURES ]
provides a summary of new features since the revision date.
All new features appear in the HELP NEW FEATURES display.
vst907
vst908
HISTORY
The HISTORY statement displays user command history in the current window.
You can scroll through commands backward or forward directly on the window sill
where the cursor is located when you enabled the sill scroll option (ALTER
SILLSCROLL ON). If it is enabled, function keys F3 and F4 scroll backward and
forward one command. Shifted function keys SF3 and SF4 display the first and last
command in the history cache. This feature eliminates the need for a fix command.
To configure the size of the history cache at run time, use a TACL PARAM statement:
PARAM HISTORYPAGES history-pages. The default size is three pages (room for
about 150 average commands). All command history shares a common cache to
ensure a correct sequential audit of the command history.
*
displays the history for all tasks associated with the SeeView process.
COUNT cmds
indicates the number of commands to display. The default is one page of
commands based on the size of the current window.
DETAIL
displays the date, time, taskid or program name, and command.
INVERT
displays commands in newest to oldest order rather than the default order of
oldest to newest.
Example
This example demonstrates the use of the HISTORY statement with the DETAIL
option.
HISTORY *, DETAIL
ELSE statement
executes the statement following ELSE.
Considerations
You can place semicolons to control the scope of compound statements as in
other block-structured languages such as PASCAL or TAL.
Example
This example shows a nested IF statement.
?MENU DownDevs
?PROC ShowDown(#DevType)
{----------------------}
{ This proc displays a menu of down devices.
{ The column number of the down "D" state info
{ is dynamically determined from the PUP output.
{----------------------------------------------}
PARM #DevType; { Type of device, "" => all
VAR #line { Line of text from pup
, DownCol { Column of "D" down STATE info
, i { Scratch variable
;
DELETE DownDevs!; { clean out menu
TASK pup:=pup; { declare pup, start listdev
WRITE pup,"listdev " & #DevType;
WITH pup; { WITH pup for #taskprompting
?PROC UpDev(#devinfo)
{-------------------}
PARM #devinfo;
BESIDE;
WINDOW pup,"listdev " & #devinfo[6:15];
?SECT main
{---------}
PAGE 2; CW;
CALL ShowDown;
INFO
The INFO statement displays information about procedures currently in the SeeView
procedure library. Procedures are added to the library when a SeeView file or cache is
invoked with the INVOKE statement, or when the file defined by the ALTER SHELL
command is invoked at startup or by means of the invoke shell function key SF15.
PROC *
displays information about all procedures currently in the SeeView procedure
library. The information includes:
The name of the file or cache that contains the procedure
QFILES
displays a list of file and cache names that contain procedures currently known to
the program.
Examples
This example shows the INFO QFILES option.
INFO QFILES
INFO PROC *
PROCS in $SYSTEM.SYSTEM.SEELOCL = 11
SEETELE @757
SEENEWMENUITEM @715
SEEMAILWHOFROM @640 x2
SEEMAILREPLY @582
SEEMAILFOLDERS @523 x1
SEEMAILCONFMENU @513
SEEMAILCONF @489
SEEMAILMENUOP @343 x21
SEEMAIL @204 x25
SEELOGGERS @161
SEEPROMPTWAIT @105 x1
--> total procs = 82, longest chain = 3 <--
Note. The x25 for the SEEMAIL PROC indicates that this PROC has been called 25
times since the script $SYSTEM.SYSTEM.SEELOCL was first invoked.
FILE edit-filename
specifies the name of the file to be invoked or executed.
CACHE taskid
designates the taskid of the cache that is to be invoked or executed.
Considerations
All procedures contained in the invoked file or cache are added to the SeeView
procedure library.
If the file or cache contains a procedure name previously defined in the library, the new
procedure replaces the old procedure.
Note. The SeeView program issues the warning message “For Faster Access INVOKE
script” when it cannot operate as efficiently as possible. This occurs if the contents of
a script previously invoked are changed since it was last invoked. Reinvoking the script
allows SeeView to re-create a procedure-entry-point directory for the script and once
again operate efficiently without the need to search for procedures linearly.
Example
This example shows the INVOKE CACHE statement.
LEFT
The LEFT statement moves the buffer address left, relative to the current buffer
address. LEFT and L are synonymous and can be interchanged.
char
specifies a single character that you can use to smear expression times in the
indicated direction.
Smear means to use the specified char to mark all locations moved through by
the move operation. For example:
RIGHT:3:# DOWN:3:# LEFT:3:# UP:3:#
This command draws a box:
###
# #
###
See also the RIGHT, DOWN, and UP statements.
Example
This example demonstrates the LEFT statement.
R:10:-
D:10:|
L:10:-
U:9:| {Draws a box.
LET
The LET statement assigns an integer variable to the value of an integer expression.
LET designational-exp
designational-exp
specifies the integer variable assignment. The integer variable is followed by a
colon and equal sign (:=) and the integer expression that is assigned to the integer
variable.
Considerations
Including the LET term in the statement is optional. (See the next example.)
Example
This example demonstrates the LET statement.
LET x:=x+1; {
x:=x+1; { Are equivalent statements
(x:=x+1);
LINE
The LINE statement defines the current buffer address where the data generated by
SeeView statements is to appear on the current screen page. Use the PAGE or
SETPAGE statements to define the current screen page.
line-exp
specifies the vertical line number location. Absolute line numbers range from 1
through 24, top to bottom of the screen page.
column-exp
specifies the horizontal column location. Absolute column numbers range from 1
through 80, left to right. If you do not specify column-exp, column 1 is assumed.
Considerations
The upper left corner of the screen is LINE 1. The lower right is LINE 24, 80.
Example
This example shows the LINE statement.
height := 24/count;
LINE25
The LINE25 statement emits a line 25 escape sequence. Text and video emitted after
the LINE25 statement appears in the line 25 status portion of the screen rather than
the current screen buffer address. (See also the
MSG statement.)
To terminate the LINE25 escape sequence, use either the BELL statement or a
carriage return character.
LINE25
Example
This example shows the LINE25 statement.
LISTDEV
The LISTDEV statement puts device names of a specified type in a given cache. Each
device name is stored in a separate line of cache. If you do not specify a device type,
all device types are stored in the cache.
TYPE devtype
specifies that device names with a devtype represented by an integer expression
should be stored in the cache associated with the task identified by the taskid-
exp.
SUBTYPE subtype
specifies that device names with a subtype represented by an integer expression
should be stored in the cache associated with the task identified by the taskid-
exp.
DETAIL
specifies that ldev-num, PPid, BPid, TYPE, SUBTYPE, and Rec-size are
displayed.
HEADING
displays column headings.
MORE count
allows you to control the maximum number of devices processed on each
LISTDEV request. Processing can be partitioned across many LISTDEV requests.
MORE also can indicate that more logical devices remain by MORE? appended to
the end of the last line output. The maximum value of count is a 32-bit signed
integer.
START ldev-num
lets you resume the LISTDEV display from the last ldev-num displayed. When
used in conjunction with the MORE option, LISTDEV can be called repeatedly to
return consecutive sets of logical devices. The maximum value of ldev-num is a
32-bit signed integer.
string-exp
specifies a string expression that contains one of these keywords:
DISC | DISK | TAPE | PRINTER | TAPE
?MENU DevMenu
?PROC ListDev (#DevType,Cacheid)
{------------------------------}
{ This proc stores a list of Device names
{ in CacheId of the type specified by #DevType.
{---------------------------------------------}
PARM #DevType { DISC,TAPE,TERM,..
, Cacheid { cache to list to.
;
DELETE Cacheid!; { Clear cache.
LISTDEV #DevType TO Cacheid;
?SECT ShowDevices
{----------------}
This example shows a general procedure that can be called repeatedly to return
ascending blocks of logical devices in a cache named Ldevs.
?SECT main
{---------
LOAD
The LOAD statement loads or places a specified file into a cache associated with a
taskid.
filename
specifies the file to be loaded.
cache-taskid
specifies the cache, represented by taskid, into which the file is loaded.
Considerations
a programmatic interface also allows loading, deleting, and displaying of the cache.
The interface uses this CONTROLBUF protocol.
Example
The statements in this example set up a cache, load it with a file named MYFILE, and
display the file in a window.
LOCK / UNLOCK
The LOCK statement locks the keyboard. Use the UNLOCK statement to unlock it.
LOCK
UNLOCK
The LOCK statement locks the keyboard associated with the SeeView terminal. This
statement is primarily intended for script implementations that make it desirable to
keep the keyboard locked while a script is being executed.
Normally when the Return or Shift-Return key is pressed, the SeeView program
immediately unlocks the keyboard so that the user can proceed to type ahead while a
script is executing. However, certain situations might make it undesirable for the
keyboard to remain unlocked while the script is executing, especially if doing so might
confuse the user. Thus you can use the LOCK statement to control keyboard locking.
Use of the LOCK statement places the responsibility of unlocking the keyboard with
the script writer. The UNLOCK statement performs this keyboard unlock function.
When in doubt, to keep users productive allow concurrency by not locking the
keyboard.
Example
This example demonstrates the LOCK statement.
?PROC StatusUser
{---------------}
{ Lock keyboard if we must start tacl
{------------------------------------}
TASK tacl;
IF #TASKSTART THEN
BEGIN { Let user know what's going on
LOCK; { while we wait for tacl prompt.
MSG "One moment, starting TACL";
FLUSH;
UNLOCK;
END
MSG
The MSG statement displays a specified message on line 25 of the terminal.
string-exp
specifies a string expression indicating the message to be displayed on line 25.
Note. The Seedit utility also has a MSG statement, different from this MSG statement.
Example
This example shows the MSG statement.
ON
The ON statement specifies the current shell file and the default subvolume of the disk
files accessed by SeeView.
ON shell-filename [ ( section-name ) ]
shell-filename
specifies the name of the file to be used as the current shell file. The volume and
subvolume names contained in the shell-filename are used to specify the new
default volume.
The primary purpose of this statement is to change the current SeeView shell file
and to change the current default volume to be the same as that of the current
SeeView shell file.
section-name
specifies that only a particular section in the shell-filename is invoked
when the shell is invoked. See also ALTER SHELL option.
Example
This example shows how to use the ON statement.
RUN SeeView /NAME/ ON $data.xyz.myscript
OPEN
The OPEN statement declares a user program taskid and creates a window for it.
startup-string-exp
specifies the startup message to be written to the process started by this OPEN
statement.
BLOCKEDIO ON | OFF
indicates whether an interprocess communication message received from taskid
can contain multiple logical messages delimited by carriage-return [line-
feed] characters.
BLOCKEDIO ON indicates that each interprocess message from taskid is
parsed into multiple logical messages if that IPC has text containing carriage-
return [line-feed] characters.
BLOCKEDIO OFF is the default, unless the name of the object file is NETACL.
CACHEPAGES pages
defines the number of cache memory pages to be allocated to this task. Cache
memory is used to store messages from the specified taskid.
CACHEPAGES has meaning only the first time a taskid is declared, and once
declared cannot be changed.
CPU cpu-number
indicates the processor number in which the program should be created. CPU has
meaning only when you are creating the program associated with the taskid. The
SeeView program communicates with $CMON when it is present and tries to use
CPU assignments indicated by $CMON.
HIGHPIN ON | OFF
specifies whether the process to be created should be a high or low PIN process.
ON implies SeeView should attempt to create a high PIN process. OFF implies
SeeView should create a low PIN process. Not all processes are capable of
running as a high PIN. There is also a global option ALTER HIGHPINTASKS ON |
OFF that controls high/low PIN creation for all OPEN, RUN, or TASK statements
without having to specify HIGHPIN on each statement.
ON implies TASK, RUN, and OPEN statements attempt to create processes that
run as high PINs. When this option is on, processes are started using the Guardian
procedure PROCESS_CREATE_.
OFF implies TASK, RUN, OPEN statements should attempt to launch low PIN
processes. When this option is off, processes are started using the Guardian
procedure NEWPROCESS.
The intrinsic #TASKPROC returns the name of the Guardian procedure used to
create the process. This intrinsic is useful as an aid to interpreting error codes
returned by the intrinsics #TASKERRORTYPE and #TASKERROR. The values
returned depend on which procedure was used to launch the process. For
information on error codes returned by the procedures PROCESS_CREATE_ and
NEWPROCESS, see the Guardian Procedure Calls Reference Manual.
LIB library-filename
specifies an external user library file of object routines. If specified, this library file
is used to resolve external references in the program being run.
ONMYVOL
indicates that the program object file name specified in the task object-name is
expected to exist on the current default SeeView volume and subvolume. You can
alter the default SeeView volume with the ALTER VOLUME statement. To
programmatically access the volume, use the #VOLSUB string intrinsic.
ONOBJVOL
indicates that the program object file name specified in the task object is
expected to exist on the same volume and subvolume as the current SeeView
program object file. To programmatically determine this volume, use the
#VOLSUBOBJECT string intrinsic.
PRIORITY process-priority
specifies the execution priority of the new process. PRIORITY takes effect only
when you are creating the program associated with the taskid. The SeeView
program communicates with $CMON when it is present and tries to use
assignments indicated by $CMON.
QUEUE ON | OFF
determines whether the SeeView program automatically replies to messages from
the specified task.
QUEUE ON indicates that the SeeView program will not automatically reply to any
messages, including simple writes, from the specified task.
QUEUE OFF indicates that the SeeView program will automatically reply to any
simple write messages from the task. It is the default.
Typically, the only time you need to specify QUEUE ON is to assert programmatic
synchronization in a script that performs complex interleaving of communication
between multiple processes. QUEUE ON always ensures communication
synchronization in a script for a single process.
STARTUP string-exp
specifies the startup message sent to the newly created process, where
string-expression represents the string written to the new process.
SWAP swap-filename
specifies the name of the file used for the page swapping of a process‟s virtual
user data space.
nodata-secs
specifies the number of seconds that a WINDOW, READ, or
WRITE statement waits for initial communication from the task.
data-secs
specifies the number of seconds that a WINDOW statement waits for
subsequent messages from the task. (See also the ALTER
NODATATIMEOUT and ALTER DATATIMEOUT statements.)
Example
This example shows the OPEN statement.
PAGE
The PAGE statement specifies which terminal page to display and where output from
subsequent SeeView statements appears.
PAGE page-exp
Considerations
User pages range from 1 through #LASTPAGE. You can programmatically select
the Help page with #LASTPAGE +1. This example summarizes how to
programmatically access the terminal pages in the SeeView environment.
The PAGE statement causes both terminal I/O and visual display to appear on the
same terminal page. To select different pages for terminal I/O and visual display
(for example, to display off-screen I/O), use the SETPAGE and
SHOWPAGE statements.
Example
This example shows how to use the PAGE statement.
PAGEMSG
The PAGEMSG statement displays a video-highlighted Page n of m message at the
current buffer address or, if after a LINE25 statement, on line 25.
PAGEMSG [ expression ]
expression
displays the message with a page number other than the current page number.
PARM
The PARM statement declares procedure parameter variable names and data types
(#string or integer). Use the CALL statement to pass parameters to a procedure (see
the CALL statement.) You can pass parameters either by value (IN) or by reference
(IO or OUT).
variable
specifies a procedure parameter variable name.
:= initialization-exp
declares the initial value of the variable. You can use an initialization expression to
specify the initial value of the parameter being declared. For example:
IN
indicates that the variable is a by-value parameter. Value assignments within the
procedure are not returned to the caller. This value is the default.
IO and OUT
indicates that the variable is a reference parameter. Value assignments within the
procedure are returned to the calling variable. The only difference between IO and
OUT is that IO documents whether the value passed to the procedure by the caller
used by the procedure declaring the parameter.
variable
specifies additional procedure parameter variable names.
Considerations
To pass parameters to a procedure, use the CALL statement. You must declare
parameters in the same order they are passed in the CALL statement.
You can specify initial values for the parameter at declaration.
All parameters are optional.
Examples
These two examples demonstrate the PARM statement.
?SECT main
{---------}
VAR done:=0;
MSG "Enter person data.";
?PROC GetPerson
{--------------}
{ Define and accept data from panel:
{
{ Name [ ]
{ Addr [ ]
{ Phone [ ]
{
{-------------------------------------------}
VAR #name
, #addr
, #ph
;
CALL Panel("Name [ ]", #name,
"Addr [ ]", #addr,
"Phone [ ]", #ph);
IF #FKEY=16 then return;
?SECT main
{---------}
{ GetPerson data until F16 is pressed.
{------------------------------------}
MSG "Please enter person data. Escape-F16.";
CLEARW;
PLOT
The PLOT statement defines the current screen buffer address. The buffer address
indicates where the output data from statements appears on the current page of the
screen.
column-exp
indicates the horizontal column location. Columns range from 0 (zero) through 79,
left to right.
row-exp
indicates the vertical row or line location. Rows range from 0 (zero) through 23, top
to bottom.
Considerations
The upper left corner of the screen is PLOT 0,0. The lower right is set at
PLOT 79,23.
The PLOT and LINE statements provide essentially the same functions but use
different coordinate systems.
Example
This example demonstrates the PLOT statement.
VAR row:=0;
PLOT 0,0;
POP
The POP statement removes an element (line of text) from a specified cache.
#string-var
specifies that the popped element is copied to #string-var.
FROM taskid
specifies the cache from which the element is removed.
TAIL
removes the last element in the cache. If you do not specify TAIL, the first element
is removed.
Considerations
#string-var can be null, “ ”, only if the cache is depleted. Otherwise, “ ” is popped
even if the element was null.
Example
This example shows the PUSH and POP statements.
?SECTION qpush
{-------------}
{ Build a cache "q" of pup listdev info, and present window on data
{----------------------------------------------------------------}
VAR #s,eof,row,col;
TASK pup :=pup;
TASK q :=$null;
DELETE q!;
WRITE pup,"listdev disc"; {do a listdev
PUSH "Current Disc Process 'active' Paths" ONTO q; {push heading
PUSH "" ONTO q; {skip a line
DO BEGIN
READ pup,#s,eof;
IF #s[20]="*" THEN PUSH #time & #s[1:50] ONTO q; {push *'ed lines
END UNTIL eof;
PAGE 1; CLEAR; {display result
WINDOW q CACHE; {in window.
?SECTION qpop
{-----------}
PRINT
The PRINT statement displays the value of an integer variable, string variable, or
string/numeric expression.
*
displays all user variables and their values. This option displays recent local
variable values for the last procedure call sequence.
string-exp | expression
specifies the integer variable, string variable, or string/numeric expression to be
printed.
Example
This example shows how to use the PRINT statement.
PRINT X,Y,Z
PRINT #S, #TAKE #S
PROMPT
The PROMPT statement prompts the output file for input when SeeView runs in CI-
mode (server mode 3 or 4). The PROMPT statement allows command interpreter
SeeView scripts. See also CI statement.
string-exp
specifies the prompt string expression to be written to the output file when the
PROMPT statement executes. Any valid string expression is permitted. For
example: PROMPT #USERNAME & " " & #TIME & " > ", #Input;
error
specifies an optional integer variable name that is set to the PROMPT file-system
error. For example, an error 1 is an end-of-file error returned when control-Y is
pressed. Error 40 occurs when a timeout occurs, if timeout is specified. If no
error option is specified and if a prompt I/O error occurs, SeeView reports a
runtime error on the prompt statement.
timeout
specifies an optional PROMPT timeout in seconds. If no timeout is specified,
PROMPT waits until the user inputs data and presses enter. While the PROMPT
waits for input, SeeView continues processing of interprocess I/O and $RECEIVE
messages. When timeout is equal to -1, the default, the prompt waits indefinitely
for user input. When timeout is greater than zero, PROMPT statements can
timeout, allowing scripts to timeout prompts.
Considerations
SeeView runs in three different modes:
Example #1
RUN SEEVIEW CI $data.test.prompt
where the file $data.test.prompt might contain this script:
VAR #p:= "?", #s, err;
DO BEGIN
PROMPT #p, #s, err;
MSG "#s=" & #s & ", err=" & err;
END UNTIL err;
Example #2
PUSH
The PUSH statement copies a string expression onto the end of the cache associated
with a user task.
string-exp
specifies the string expression to be copied.
ONTO taskid
specifies the user task.
Considerations
When a null string, “ ”, is pushed, it is stored as such. However, a single blank, “ ” is
returned for a POP operation. This simple means tests for an empty cache.
Example
This example shows the PUSH and POP statements.
?SECTION qpush
{-------------}
{ Build a cache "q" of pup listdev info, and present window on data
{----------------------------------------------------------------}
VAR #s,eof,row,col;
TASK pup :=pup;
TASK q :=$null;
DELETE q!;
WRITE pup,"listdev disc"; {do a listdev
PUSH "Current Disc Process 'active' Paths" ONTO q; {push heading
PUSH "" ONTO q; {skip a line
DO BEGIN
READ pup,#s,eof;
IF #s[20]="*" THEN PUSH #time & #s[1:50] ONTO q; {push *'ed lines
END UNTIL eof;
PAGE 1; CLEAR; {display result
WINDOW q CACHE; {in window.
?SECTION qpop
{-----------}
{ Display data from a taskid's cache on terminal page 2.
{------------------------------------------------------}
LET row:=-1; LET col:=0;
PAGE 2; CLEAR;
DO BEGIN {display Q data
POP #s FROM q; {"outside" of
READ
The READ statement reads data from a user task or a cache associated with a user
task.
taskid
specifies the taskid of the task to be read. (For information regarding taskids,
see the
TASK statement.)
*
causes the CACHE option to access the SeeView message cache rather than a
taskid cache. The asterisk option requires the use of the CACHE option.
PEEROK
indicates that the READ can complete when any peer task associated with the
specified taskid writes a message to the SeeView program. Peer tasks are all
tasks that have the same $SeeView-process-name #taskid subdevice
opened.
Without this option, the SeeView program waits specifically for a message from
only the specified taskid.
When you use PEEROK, use the intrinsic #TASKIDLASTREAD to determine the
actual taskid of the peer task that caused the READ statement to complete.
CACHE index
specifies that data is moved from the cache associated with the taskid rather
than being read from the task in real time.
index
specifies the ordinal record index in the cache. CACHE indexes 0, 1, 2, …,
correspond to the first, second, third, …, records in cache. Indexes -1,-2,-3, …,
correspond to the last, second from last, third from last, …, records in cache.
error
specifies that the result of the READ statement is programmatically determined by
setting an integer variable to one of these values:
1 if the task is prompting for input, or an end-of-file is encountered when using the
CACHE option.
40 if a read timeout occurred. (See the TIMEOUT option of the TASK statement.)
#string-var
transfers data to the string variable rather than to the screen.
Example
This example shows the READ statement.
VAR #s;
TASK f:=fup;
WRITE f,"copy xyz";
WITH f;
DO BEGIN
READ f,#s;
IF (NOT #taskprompting) AND (#TAKE #s)="MYDATA" THEN BEGIN
[#s]; { show all records starting with the word MYDATA
END;
END UNTIL #TASKPROMPTING;
RETURN
The RETURN statement causes the SeeView interpreter to stop executing the current
section or procedure and returns control to the calling procedure or section.
RETURN
All procedures and sections contain a logical return after all statements are
executed in the procedure or section. When either a logical or explicit return
occurs, control returns to calling procedure, section, or menu production.
In scripts that contain multiple sections and have explicit returns in them, the next
section in the script is executed when a RETURN is encountered.
Example
This example shows the use of the RETURN statement.
?PROC CurrentDate
{----------------}
IF #DATE[4:8] = "01/01" THEN BEGIN
MSG (REVERSE) "Happy new year"; BELL;
RETURN;
END;
MSG "Date " & #DATE;
RIGHT
The RIGHT statement moves the buffer address right, relative to the current buffer
address. RIGHT and the abbreviation R are synonymous. You can interchange them.
expression
allows for moves greater than one.
char
specifies a single character that you can use to smear expression times in the
indicated direction.
Smear means to use the specified char to mark all locations moved through by
the move operation. For example:
RIGHT:3:# DOWN:3:# LEFT:3:# UP:3:#
This command draws a box:
###
# #
###
See also the LEFT, UP, and DOWN statements.
RULER
The RULER statement draws a ruler.
RULER
Considerations
If you enter the statement from a window, the ruler is drawn relative to the window.
Otherwise, the ruler is drawn on the current terminal page.
Example
Enter this example from a window to paste a video-highlighted ruler to the top of that
window.
RUN
The RUN statement starts a specified program and passes complete control of the
terminal to that program until the program is stopped or abends.
The RUN statement is useful for temporarily leaving the SeeView environment to run a
program that cannot execute within a window. Upon exiting this program, all windows
and their associated programs are returned to the same state as before the RUN
statement executed.
startup-message
specifies a startup message either:
ALLOWERROR
allows the SeeView interpreter to continue execution without reporting new
process errors that occur due to the task declaration. You can use the
#TASKERRORTYPE, #TASKERROR, #TASKPROC, and #TASKSTART intrinsics
with this option to provide programmatic recovery from TASK declaration errors.
The #TASKERROR and #TASKERRORTYPE values returned are a function of the
procedure used in the attempt to start the process. The #TASKPROC intrinsic
CPU cpu-number
indicates the processor number in which the program is created. The SeeView
program communicates with $CMON when it is present and tries to use CPU
assignments indicated by $CMON.
HIGHPIN ON | OFF
specifies whether the process to be created should be a high or low PIN process.
ON implies SeeView should attempt to create a high PIN process. OFF implies
SeeView should create a low PIN process. Not all processes are capable of
running as a high PIN. There is also a global option ALTER HIGHPINTASKS ON |
OFF that controls high/low PIN creation for all OPEN, RUN, or TASK statements
without having to specify HIGHPIN on each statement.
ON implies TASK, RUN, and OPEN statements attempt to create processes that
run as high PINs. When this option is on, processes are started using the Guardian
procedure PROCESS_CREATE_.
OFF implies TASK, RUN, OPEN statements should attempt to launch low PIN
processes. When this option is off, processes are started using the Guardian
procedure NEWPROCESS.
The intrinsic #TASKPROC returns the name of the Guardian procedure used to
create the process. This intrinsic is useful as an aid to interpreting error codes
returned by the intrinsics #TASKERRORTYPE and #TASKERROR. The values
returned depend on which procedure was used to launch the process. For
information on error codes returned by the procedures PROCESS_CREATE_ and
NEWPROCESS, see the Guardian Procedure Calls Reference Manual.
IN filename
specifies the input file.
NAME process-name
specifies the symbolic name assigned to the newly created process.
ONMYVOL
indicates that the program object file name specified in the RUN program is
expected to exist on the current default SeeView volume and subvolume. To alter
the default SeeView volume, use the ALTER VOLUME statement. To
programmatically determine the volume, use the #VOLSUB string intrinsic.
ONOBJVOL
indicates that the program object file name specified in the RUN program is
expected to exist on the same volume and subvolume as the current SeeView
program object file. To programmatically determine the volume, use the
#VOLSUBOBJECT string intrinsic.
OUT filename
specifies the output file.
PRIORITY process-priority
specifies the execution priority of the new process. The SeeView program
communicates with $CMON when it is present and tries to use assignments
indicated by $CMON.
STARTUP string-exp
specifies the startup message sent to the newly created process. (See the RUN
statement description of startup-message.)
SWAP swap-fname
specifies the name of the file used for the page swapping of a process‟s virtual
user data space.
Example
This example shows various methods for using the RUN statement.
SAVE
The SAVE statement saves data associated with a task‟s cache memory.
filename
specifies the disk file to which the SAVE statement permanently saves data. The
task's operational status is not affected.
You can specify the file name directly as part of the statement. For example:
SAVE $data.mysubvol.myfile, #taskid
Or you can specify it as a string expression. For example:
SAVE #myfile, #taskid
APPEND
appends the contents of the specified cache to the end of the specified filename.
!
purges the contents of the file represented by filename (if it exists) and saves the
cache as filename.
cache-taskid
specifies that the cache associated with taskid is saved. When you use the
SAVE statement in a script, cache-taskid or * is required.
Considerations
If you use the window editor to load a file into a window through the Seedit GET
command, that window contains a copy of the file. When you enable edit mode, the
window heading includes the file name of the file copied into that window.
When you enter SAVE with no file name and without the [!] option, you replace or
purge the original file with the modified cache copy of the file to be saved. The cache
copy of the file is only a copy and not the actual file. Type ESCAPE to exit edit mode
without saving the cache to a file. However, you can reenable edit mode and perform a
subsequent save.
Example
This example shows the SAVE statement issued from a SeeView script.
TASK comint:=$system.system.comint;
DELETE comint!;
WRITE comint,"status *,term";
WRITE comint," "; {force SeeView to wait for all of the response
SAVE junk.myterm!,comint;
This example shows a SAVE statement are issued from a window in edit mode. S is an
abbreviation for SAVE only when it is entered from the sill of an edit-mode window.
SCAN
The SCAN statement finds a target string in a string expression or scans a string
expression while a certain character exists.
BACK
specifies that the string is scanned backward, from right to left. Not specifying
BACK causes the string to be scanned from left to right (the default).
UNTIL target-string
specifies that the scan of the scan-string continues until the string
expression represented by target-string is found. You can use a multiple
character target for the target string. For example:
SCAN #s UNTIL "apple";
WHILE target-char
specifies that the scan of the scan-string is to continue while the character
represented by the target-char continues to exist. Thus
SCAN "...x" WHILE "."->i;
sets “i” to a value of 4. For the target-char, you can use any string
expression that yields a single character, such as “.” or #char(c+i).
int
stores the string index 1...132 where the condition exists in the integer variable
represented by int if the condition is satisfied. If the condition is not satisfied,
it sets int-var to 0 so that it can be used as a Boolean.
Example
This example shows the SCAN statement.
VAR #s := "...x..x";
SCAN "the 123 is the target" UNTIL "123" -> X; { X = 5
SCAN "the 123 is the target" UNTIL "124" -> X; { X = 0
SCAN "...x..x" WHILE "." -> X { X = 4
SCAN #s WHILE "." -> X { X = 4
SCAN #s[5] WHILE "." -> X { X = 7
SCAN BACK #s[5] WHILE "." -> X { X = 4
taskid
specifies the taskid of the cache that is searched for target.
CACHE
specifies that the cache search target follows:
[ + | - ]
specifies whether the search is forward + (top-down and left-to-right search), or
backward - (bottom-up and right-to-left). + is the default search direction.
target
specifies the search target string. For the target string, you can use either a
string expression that consists of string variables, string literals or both, or
literal text delimited by a pair of slash or backslash characters such as /target/
or \target\.
If the target is found, the integer variables specified by line (and optionally
col) are set to the cache line (and column) where the target was found. If the
target is not found, the line (and optionally column) are set to a minus 1 (- 1)
value.
line
specifies an integer variable that is set to the value of the ordinal cache
line number where target was found. Integer values for line are zero
relative, so a line value of zero is the first line of cache.
LINEFOUND string-var
assigns a string variable, string-var, to the line of text that contains the
target.
MENUTEXT
restricts the search to text only to the left of any production symbols (<==) that are
present in cache.
Examples
This example shows the SEARCH statement.
?MENU myData
line 1 {cache index 0
line 2 {cache index 1
line 3 {cache index 2
?SECT Main
VAR L {cache line index
, C {cache column number
, #s := "2"; {target
;
SEARCH MyData CACHE #s -> L,C; { L and C will be L=1, C=6
This procedure uses a SEARCH statement to search through a cache, changing all
occurrences of #target to #newtext. (The search is not case-sensitive.)
?PROC Change
{-----------}
{ Accept "ChangeWhat" panel and pass request to ChangeCache proc
{---------------------------------------------------------------}
LINE #MENULINE,#MENUCOL; { Position to calling panel
VARIABLE #Cache, #Target, #NewText; { Declare variables
ACCEPT #Cache, #Target, #NewText; { Accept panel data.
EXE "WITH " & #Cache; { Get "WITH Cachename"
BELOW;
WINDOW #taskid CACHE FIRST SIZE 80,8; { Show cache before changes
IF #Target=""or#NewText=""THEN RETURN;
DOWN:8;
WINDOW #taskid CACHE FIRST SIZE 80,8; { Show cache after changes
?SECT main
{---------}
BESIDE; CW;
vst909
SECURE
The SECURE statement restricts usage of SeeView statements and function keys. The
restriction can apply to either the interactive user level only or to both the interactive
and scripting level.
DENY
indicates that the specified statement stmt or function-key fkey primitive cannot
be used.
DENY is the default.
*
signifies ENABLE all statements and function keys.
SILL
limits restriction to interactive sill input. When you specify SILL, the restriction
applies only to statements entered interactively.
SILL is the default.
ANY
restricts any and all use of a stmt or fkey.
stmt
refers to any of the statements described in this manual.
Fkey
refers to these keywords:
F1 … F16 BREAKKEY
SF1 … SF16 INSERTLINE
DELETELINE ROLLDOWN
ROLLUP SROLLDOWN
SROLLUP PREVPAGE
NEXTPAGE SPREVPAGE
SNEXTPAGE SRETURN
RETURNKEY
Considerations
Use the SECURE statement to restrict access to internal SeeView objects (statements
and functions keys). To restrict access to external objects, such as programs or files,
use the Safeguard command interpreter SAFECOM. You can define Safeguard
access-control lists (ACLs) for external SeeView menu items and tasks because these
items are HPE NonStop files.
Example
These examples show the SECURE statement.
SETPAGE
The SETPAGE statement directs host data input and output to a page other than the
one currently displayed through the
SHOWPAGE statement.
SETPAGE expression
expression
specifies a page other than the one currently displayed through the SHOWPAGE
statement to direct host data input and output. Values less than one are not
allowed.
Example
This example shows the SETPAGE statement.
VAR pg:=0;
FOR 6 DO BEGIN {Clear pages 1-6 without showing them
SETPAGE (pg:=pg+1);
CLEAR;
END;
SHOWPAGE
The SHOWPAGE statement displays a terminal page other than the one to which host
data input and output are currently directed.
SHOWPAGE expression
expression
specifies a terminal page other than the one to which host data input and output is
currently directed. You cannot use values less than one.
Example
This example shows the SHOWPAGE statement.
VAR pg:=0;
FOR 6 DO BEGIN {Display each page for 2 seconds
SHOWPAGE (pg:=pg+1);
WAIT 2;
SHUTDOWN
The SHUTDOWN statement stops the SeeView program and all associated user-
defined tasks.
EXCEPT TASKS
indicates that tasks are not stopped when SeeView is shut down.
EXCEPT PEERS
indicates that any peer tasks not declared directly via a
TASK statement are not stopped when SeeView is shut down.
Considerations
This statement is similar to pressing SF16 twice. That is, shutdown cannot occur if any
windows are in edit mode. This prevents accidental loss of edited text in any edit-mode
windows.
Example
This example shows the SHUTDOWN statement.
STATUS
The STATUS statement displays the status of processes that are communicating with
the SeeView program.
The STATUS statement includes information about the total number of system and
user messages received by SeeView. This statement also displays the number of
IOPOOL pages used and allocated and the total number of IOPOOL gets and puts
since SeeView was started.
Function key F13 displays TASK status in the largest free window on the Help page.
STATUS [ taskid | * ]
taskid | *
displays status information for one specific taskid. Use the asterisk * to display
menu data information in addition to task data regardless of the setting of the
ALTER MENUSTATUS option. (See ALTER 160.)
Example
A sample status display follows:
STOP
The STOP statement stops a specified SeeView process.
STOP [ taskid-exp ]
[ \node. ] [ $name ] [ ! ]
[ \node. ] [ cpu,pin ] [ ! ]
\ node
specifies the system node name where the process to be stopped exists.
$name
specifies the process name of the process to be stopped.
cpu, pin
specifies the processor number and process identification number of the program
to be stopped.
!
causes SeeView to stop non-SeeView tasks if SeeView has proper security access
to those tasks.
Example
This example shows the STOP statement.
STOP edit;
STOP 1,113;
STOP \chicago.$Z123; STATUS
TASK
The TASK statement declares a taskid name to be associated with a program on a
NonStop system.
After you declare a TASK, you can communicate with it through various SeeView
statements. The scope of the declared taskid is global, and you can reference it from
any menu, section, or procedure.
taskid
identifies a symbolic task name to be associated with a program defined to the
SeeView program.
For task variable names, you can use any combination of alphanumeric characters
up to 15 characters in length, but the eighth character cannot be numeric.
If you do not specify a previously declared taskid or an object assignment
(:=object-name), SeeView attempts to start a program with the taskid name
on the $SYSTEM.SYSTEM subvolume. Once the program is declared, subsequent
references to the program name are actually references to its taskid. For
example, TASK TACL starts a TACL process on $SYSTEM.SYSTEM if TACL is an
unknown taskid. However, if TACL has been previously declared with TASK
TACL:= $vol.subvol.object, the TASK TACL statement reasserts a process
that has a symbolic taskid name of TACL but whose object file name is
$vol.subvol.object.
object-name
specifies either an object file on disk or a process ID. Processes not declared by
the SeeView program can gain access through a taskid socket by opening the
SeeView program with: $SeeView-process-name.#taskid, for example,
$See.#Socket.
When object-name is a program object file name, that process is started with its
IN and OUT files assigned to the SeeView process ID. Subsequent execution of
the same TASK statement does not result in process creation if that process is still
startup-string-exp
specifies the startup message to be written to the process started by this TASK
statement. You can specify the startup message as: TASK FUP “INFO *”or as
TASK FUP STARTUP “INFO *”.
ALLOWERROR
allows the SeeView interpreter to continue execution without reporting new
process errors that occur due to the task declaration. You can use the
#TASKERRORTYPE, #TASKERROR, #TASKPROC, and #TASKSTART intrinsics
with this option to provide programmatic recovery from TASK declaration errors.
The #TASKERROR and #TASKERRORTYPE values returned are a function of the
procedure used in the attempt to start the process. The #TASKPROC intrinsic
indicates whether NEWPROCESS or PROCESS_CREATE_ was used in the
attempt to declare the task. For example:
RUN FUP ALLOWERROR;
IF #TASKPROC = "PROCESS_CREATE_" THEN BEGIN
IF #TASKERRORTYPE=1 AND #TASKERROR=11 THEN BEGIN
MSG "File not present";
END;
END;
IF #TASKPROC = "NEWPROCESS" THEN BEGIN
IF #TASKERRORTYPE=3 AND #TASKERROR=11 THEN BEGIN
MSG "File not present";
END;
END;
CACHEPAGES pages
defines the number of cache memory pages to be allocated to this task. Cache
memory is used to store messages from the specified taskid.
CACHEPAGES takes effect only the first time you declare a taskid. Once declared,
it cannot be changed.
COPY copy-taskid
causes all messages received by the current task to also be copied to the CACHE
associated with the copy-taskid. The copy mechanism is enabled until a prompt
is received from the task referenced in the TASK statement.
One use of this mechanism is to allow the SeeView program to dynamically load a
displayed menu with the response from a process. (See Examples on page
263263.)
CPU cpu-number
indicates the processor number for the program to be created in. CPU takes effect
only when you are creating the program associated with the taskid. The
SeeView program communicates with $CMON when it is present and tries to use
CPU assignments indicated by $CMON.
PROCESS
indicates that the SeeView program replies to DEVICEINFO messages from
the declared task with a device type 0,0.
TERMINAL
indicates that the SeeView program replies to DEVICEINFO messages from
the declared task with a device type 6,0. The procedure DEBUGPROCESS
requires that the TERMINAL device type for the file where the debug prompt is
to appear. Before you use the TACL DEBUG command, check that the device
type returned to TACL by the SeeView program is a TERMINAL. To do so at
any time, enter this SeeView statement and press Shift-Return:
TASK TACL DEVTYPE TERM
FORMATDATA format-strg-rules
specifies a string expression that causes the SeeView program to automatically
reformat each message received from the specified taskid. The format-strg-
rules string expression is any valid string expression containing #TASKDATA
string intrinsic references. To reformat selected data from each message, specify
the desired fields in the format-strg-rules expression.
For example, to format FUP INFO output automatically so that each line of output
is preceded with “[ ]” and terminated with a prompt production symbol “<==?”:
TASK FUP FORMAT "'[ ]' & #TASKDATA & '<==?'";
WRITE FUP,"INFO *";
WINDOW FUP MENU "CALL DoOp(#MENUINPUT");
Thus you can reformat the output so that each line contains an input field and is
defined as a prompt production.
FORMATDATA “” disables the format option.
IN filename
specifies the input file.
LIB library-filename
specifies an external user library file of object routines. If specified, this library file
is used to resolve external references in the program being run.
NAME process-name
specifies the process name assigned to the newly created process.
ONMYVOL
indicates that the program object file name specified in the TASK object-name
is expected to exist on the current default SeeView volume and subvolume. You
can alter the default SeeView volume with the ALTER VOLUME statement. To
programmatically determine this volume, use the #VOLSUB string intrinsic.
ONOBJVOL
indicates that the program object file name specified in the TASK object-name
is expected to exist on the same volume and subvolume as the current SeeView
program object file. To programmatically determine this volume, use the
#VOLSUBOBJECT string intrinsic.
QUEUE ON | OFF
determines whether the SeeView program automatically replies to messages from
the specified task.
QUEUE ON indicates that the SeeView program does not automatically reply to
any messages, including simple writes, from the specified task.
QUEUE OFF indicates that the SeeView program automatically replies to any
simple write messages from the task. QUEUE OFF is the default.
Typically, the only time you need to specify QUEUE ON is to assert programmatic
synchronization in a script that performs complex interleaving of
WRITE and READ statements between multiple processes. Communication
synchronization in a script for a single process is always ensured unless WRITE
and READ statements are interleaved with one of more
WAIT statements.
start
indicates the starting character index in each cache element where sort
comparisons between cache elements are to occur. A valid start value is
from 1 through 132. When you specify start without end, only that one start
end
indicates the ending character index in each cache element where sort
comparisons between cache elements are to occur. A valid end value is from
1 through 132, where end is greater than or equal to start. For example,
SORTED[10:19] sorts records based on the contents of character positions 10
through 19 of each cache record.
STARTUP string-exp
specifies the startup message to be sent to the newly created process.
SWAP swap-filename
specifies the name of the file used for the page swapping of a process‟s virtual
user data space.
nodata-sec
specifies the number of seconds that a WINDOW, READ, or
WRITE statement is to wait for initial communication from the task.
data-sec
specifies the number of seconds that a WINDOW statement is to wait for
subsequent messages from the task. (See also the ALTER
NODATATIMEOUT and ALTER DATATIMEOUT statements.)
NonStop Openers: Tasks that run NonStop should open the SeeView program
when their backup process takes over rather than use paired OPEN operations via
CHECKOPEN prior to takeover. Opening the display device at takeover is the
mechanism used by TACL.
Examples
The following example demonstrates the TASK statement.
TASK fup;
TASK discs := pup STARTUP "listdev disc";
TASK e := enform VOLUME $system.public;
The following example displays how the TASK … COPY statement works.
?SECT main
{---------}
LINE 4; { Show info on line 4 of pg 1.
CALL ShowFileInfo(#VOLSUB); { Note #VOLSUB is an intrinsic
TRANSLATE
The TRANSLATE statement defines how characters are translated when the ALTER
CACHEFILTER ON option is enabled.
INITIALIZE
initializes the translate table so that all non-visible control characters are translated
to spaces. This is the default value of the translate table. It is equivalent to:
TRANSLATE 0 .. 31 TO " "; { translate null .. us TO space
TRANSLATE 14 TO 14; { allow shift-out to passthru
TRANSLATE 15 TO 15; { allow shift-in to passthru
TRANSLATE 27 TO 27; { allow escape to passthru
char
specifies either a string expression or a decimal integer. For example:
TRANSLATE "abc" to "ABC"
The equivalent is:
TRANSLATE 97..99 TO 65..67;.
Considerations
The TRANSLATE statement applies to all information to be stored in cache. It applies
to all subsequently received data from user tasks and also to data input via the window
editor. This statement has some other usages. This example causes all lowercase text
received in cache to be put in uppercase:
TRANSLATE "a" .. "z" TO "A" .. "Z";
UP
The UP statement moves the buffer address up relative to the current buffer address.
UP and U are synonyms that you can interchange.
UP | U [: expression [: char ] ]
expression
allows for moves greater than one.
char
specifies a single character that you can use to smear expression times in the
indicated direction. Smear means to use the specified char to mark all locations
moved through by the move operation. For example:
RIGHT:3:# DOWN:3:# LEFT:3:# UP:3:#
This command draws a box:
###
# #
###
See also the DOWN, LEFT, and RIGHT statements.
Example
This example shows the UP statement.
VARIABLE
The VARIABLE statement declares string and integer variables. The VARIABLE
statement and the DECLARE statements are equivalent.
variable
specifies the symbolic variable name of a string or integer variable. If you prefix
variable with a pound sign (#), it represents a string variable. Otherwise, it
represents an integer variable. String variables can contain up to 132 characters
initialization-exp
specifies an optional initialization expression used to initialize the value of the
declared variable.
The initialization-exp can be either an integer expression such as (5+x/60),
or a string expression such as "THE TIME IS " & #TIME.
You can initialize string variables to either a string or integer value. You must
initialize integer variables to an integer value.
String variables declared with no initialization-exp have an initial value
equal to the null string “”. Integer variables declared with no initialization-
exp have an initial value equal to minus one (-1).
Example
This example shows the VARIABLE statement using multiple variables.
VAR x := 15
, y := x*2
,#s := "x= " & x & ", y= " & y { x= 15, y= 30
,#t := #s[1:5] { x= 15
,#z := #TAKE #s { X
;
VIDEO
The VIDEO statement defines video attributes beginning with the current buffer
address. Each option identifies a T6500 terminal video attribute.
BLINK
specifies the blinking video attribute for the screen area starting at the current
buffer address.
DIM
specifies the dim video attribute for the screen area starting at the current buffer
address.
REVERSE
specifies the reverse video attribute for the screen area starting at the current
buffer address.
UNDERLINE
specifies the underline video attribute for the screen area starting at the current
buffer address.
video-exp
specifies an integer expression surrounded by left and right square brackets that
indicates the bit-wise T6500 terminal video attributes. You can use the
[video-exp] in place of attribute keywords enclosed in parentheses. For example,
VIDEO [4+1] is equivalent to VIDEO (REVERSE DIM).
Video attribute bit values are:
[ 1] dim
[ 2] blink
[ 4] reverse
[ 8] blank
[ 16] underline
You can use the video-exp option with the #FVBODY or #FVMENUBODY
intrinsics to set video attributes at the current buffer address to match the attributes
defined by the FRAMEVIDEO statement.
Considerations
You can use video attributes alone or in combination with other video attributes,
such as, VIDEO (REVERSE) or VIDEO (REVERSE DIM).
Example
This example shows how you can use the VIDEO statement.
{draw a checkerboard
CLEAR; LINE 1;
FOR 20 DO BEGIN
FOR 6 DO BEGIN
VIDEO(REVERSE DIM); RIGHT:8; VIDEO(); LEFT:8
DOWN;
END;
RIGHT:8;
END;
WAIT
The WAIT statement temporarily suspends operation of the SeeView interpreter for a
specified period while interpreting a SeeView script.
expression-seconds
specifies an integer expression that indicates the number of seconds to suspend
the interpreter.
REFRESH
indicates that all windows on the current page are automatically updated in real
time during the wait interval.
Considerations
Pressing the BREAK key terminates the WAIT period and the compilation
sequence.
WAIT 0, REFRESH refreshes the screen immediately if cache is out of sync with
the current state of any window on the current terminal page. This provides a
simple way from within a script to have SeeView automatically and instantaneously
update all windows on the current page.
WAIT 5, REFRESH automatically refreshes all the windows on the current page
and then suspends execution of the SeeView interpreter for five seconds. If you
Example
The MonitorPages procedure in this example shows the WAIT statement.
expression
specifies a logical or integer expression to be evaluated before each iteration to
determine whether statement is executed. The statement is executed if the
expression has a nonzero value. expression can be either a logical expression,
(A>B AND #s="YES"), or an integer expression, such as (i+1-x).
DO statement
specifies any valid SeeView statement, including a compound statement.
Considerations
You can use a BEGIN term, followed by multiple statements and an END term, to
delimit compound statements for execution. You can use nested statements.
Example
This example shows how to use the WHILE statement.
?MENU Nodes
?PROC ShowNodeNames
{------------------}
{ Display menu of network node names
{-----------------------------------}
VAR #s { output from netmon
,#sysno { system number
, i { system name column index
;
TASK netmon;
WRITE netmon,"cpus";
DELETE nodes!;
WITH netmon;
?SECT main
{---------}
CALL ShowNodeNames;
WINDOW
The WINDOW statement builds a window or menu at the current screen buffer
address. You specify the address for the window with the BELOW, BESIDE, LINE,
PLOT, LEFT, RIGHT, UP, or DOWN statements. You specify the size of the window
with the SIZE option. (See the SIZE option in this subsection.) Default window frame
attributes are GLASS, OPEN, and SILL. GLASS protects the window text area unless
it is edit mode. OPEN enables you to access the window object by moving the cursor
to some part of the window, entering text, and pressing Return. SILL provides an input
area at the base of the window.
*
specifies that a free, unassigned window is built. You can use a free window to
communicate directly with the SeeView interpreter.
[ ]
builds a window on the most recently user-referenced taskid. This taskid is the
taskid of the window that last invoked a script production. This lets you use
WINDOW statements that do not specifically reference a taskid, thus promoting
generalized programming techniques that do not depend on specific taskids.
This specification also allows an external program to dynamically generate
SeeView menu productions and associated window statements in its output text so
that this text can be used as a self-referential menu, without the need to know the
taskid of this menu. For example, a program might generate a line of output in a
menu to contain:
HELP <== WINDOW [],"HELP ALL" NOFRAME
When the user selects this menu line, the program associated with the menu
receives the command HELP ALL and displays the results of that command in the
same window.
In a similar manner, other text output by a program can have productions
associated with the objects that it displays. For example:
Cpu 0 <== WINDOW [],"CPU 0,DETAIL" NOFRAME
task-exp
specifies an integer expression indicating the taskid number of the task whose
data is to be displayed in the window.
string-exp
causes the window to contain the results of the
TASK command represented by the string expression, string-exp.
CACHE
specifies that the window is displayed with previously cached messages rather
than waiting for real-time task interprocess communication.
FIRSTPAGE
displays the first page of messages in cache (default).
LASTPAGE
displays the last page of messages in cache.
LASTLINE | LL
displays the last line of text in cache.
INDEX index
displays cache messages beginning with the cache line indicated by the
index expression.
index
specifies the ordinal record index in the cache. Indexes 0, 1, 2, …,
correspond to the first, second, third,... records in cache, and indexes -1, -
2, -3,. …, correspond to the last, second from last, third from last,...,
records in cache.
[ + | - ] target
displays cache messages beginning with the target text specified. The search
is bidirectional: + specifies searching forward, and - specifies searching
backward through the cache for the target text.
target can be either text between delimiters, such as /this is the target/, or a
string variable, such as [ + | ]#string-var.
If you specify MENU before the cache option, the search is restricted to the
text to the left of the production symbol. If you do not specify MENU or you
specify it after the cache option, the search includes all characters in the
cache.
NOCLEAR
implies that the WINDOW statement fails with a run-time error if this window
overlaps other windows. Not specifying either this option or the CLEAROVER
option causes windows other than edit mode to be automatically deleted.
CURSOR
specifies whether the cursor is moved to this window.
The default is CURSOR, which means that the cursor is moved to the current
window.
NOCURSOR
prevents cursor repositioning.
EDIT
specifies that a window is created in edit mode. When you create a window with
the EDIT option, the window has edit mode enabled. You can edit the text
appearing within an EDIT window immediately.
To disable an edit-mode window, place the cursor on its sill, type either Save (S) or
Escape (E), and press the Enter key.
NOEDIT
specifies that a window is created in normal mode, not in edit mode. NOEDIT is
the default.
To place windows that are not menus in edit mode, press F5 or F6 from their sill.
EOFONLY
pages directly to the last page of window cache. You can toggle the EOFSEEK
and EOFONLY attributes on and off with the DEL-LINE key on the right side of the
keyboard.
EOFSEEK
causes a window to dynamically seek the last page of messages in cache by
refreshing the display with the most recent messages every REFRESH seconds
The FIELDS option in conjunction with the script development facility on the Help
page provides a what-you-see-is-what-you-get (WYSIWYG) screen builder
capability that allows instantaneous prototyping.
For example:
?MENU Employee
{-------------}
{ The following defines an Employee panel. Note:
{ 1) [ ] defines input fields
{ 2) :: defines corresponding video and field attributes
{-------------------------------------------------------}
First [ ] Last [ ] :: (alpha) (alpha)
Street[ ]
City [ ] State[ ] Zip[ ] :: (a) (a) (n)
Phone [ ] Home [ ] :: (n) (n blank)
*
?PROC ShowEmp
{------------}
WINDOW Employee FIELDS (reverse dim) { default reverse dim
MENU "CALL AcceptEmp"
CACHE FIRST UNTIL "*" SIZE 20
KEYS F5, F6, F7
HEAD "Add-F5 Delete-F6 List-F7";
?PROC AcceptEmp
{--------------}
LINE #MENULINE,#MENUCOL;
VARIABLE #first, #last, #addr, #city, #st, #zip, #office, #home;
ACCEPT #first, #last, #addr, #city, #st, #zip, #office, #home;
IF #FKEY=5 THEN CALL AddEmp;
IF #FKEY=6 THEN CALL DeleteEmp;
IF #FKEY=7 THEN CALL ListEmp;
FOOT string-exp
specifies text that appears on the sill of a window. When you specify FOOT with a
window that has a sill, the cursor is automatically positioned at the end of the foot
text string.
FOR linecount-exp | *
specifies the width and height of the window. One purpose of this option is to size
popup menus. The FOR option sets the height of the window to linecount-exp.
The width of the window is set to #MENUWIDTH, which is the width of the last
menu referenced with the Return key. You can use the SIZE option to specify
another width.
*
specifies the height of the window to be as tall as possible and the width to be
the value of #MENUWIDTH.
FRAME
draws the window frame (default).
NOFRAME
suppresses the redrawing of the frame and heading if there is already a window at
the current location with the same size and window attributes. This is especially
useful in menu productions to provide very fast I/O-efficient popup displays in a
window.
For example:
WINDOW FUP,"INFO *" NOFRAME CACHE LASTLINE;
GLASS | NOGLASS
specifies whether the main body area of the window is protected from cursor
access (GLASS) or not protected (NOGLASS). You can also use the insert free
cursor on or off function key (SF5) to control cursor access to the main area of the
window.
HEADING heading-string-exp
specifies the heading to appear at the top of the window. If you do not specify a
heading, and the window has a taskid associated with it, the SeeView program
automatically displays that taskid name in the heading of the window.
INPUT | NOINPUT
indicates whether a user can input commands to the window.
INPUT permits commands to be input (default).
?SECT PsmailWindow
TASK psmail;
WINDOW psmail HEAD "F6-Delete F9-Print"
KEYS F6, F9
PRODUCTION "CALL MailProc";
?PROC MailProc
VAR #cmd;
IF #FKEY= 6 THEN #cmd := "DELETE " & #take #menutext;
IF #FKEY= 9 THEN #cmd := "PRINT " & #take #menutext;
LINE #MENULINE,#MENUCOL;
WINDOW psmail,#cmd CACHE LASTLINE NOFRAME;
fkey-list
refers to a comma-separated list of any of these keywords:
VARIABLE #mykeys:=
"SILL F5, F6, F7".
WINDOW .. KEYS #mykeys;
SAME
specifies that the function key list for this window should be the same as the
list associated with the window that caused a script to be invoked. Use SAME
when you want your script to create or reassert a window with the same fkey-
list as the previously invoked menu or window.
OFF
indicates that the window should have no function keys enabled for it. To
globally specify the KEYS option, use the ALTER KEYS option.
shift-production
specifies a string expression containing SeeView statements that are executed
when you select a menu item by pointing the cursor to the menu item and
pressing Shift-Return. Shift-Return causes the shift production to be executed.
Conceptually, Return is analogous to a mouse click and invokes the default
production. Shift-Return is analogous to a double-click and invokes the shift
production.
OPEN
specifies that you can access the window object by moving the cursor to some part
of the window, entering text, and pressing Return.
CLOSED
indicates that the window is drawn only. Once displayed, its existence is unknown
to the SeeView program.
PAGES
lets you page and scroll the window text.
NOPAGES
prevents you from paging or scrolling a window‟s text. Use this option with the
MENU option to restrict features that might bother inexperienced users.
default-production
specifies a string expression containing SeeView statements that are executed
when you press any of the function keys in the KEYS option fkey-list when
the cursor is in the corresponding KEYS option BODY or SILL area of the
window. If the Return key is to invoke the default production, you must include
the Return key in the KEYS option specification. For example:
KEYS BODY RETURNKEY, F5, F6;.
shift-production
specifies a string expression containing SeeView statements that are executed
when you select a window by pointing the cursor to the window and pressing
Shift-Return. Shift-Return causes the shift production to be executed.
If the Shift-Return key is to invoke the shift production of a nonmenu window,
you must include the key in the KEYS option specification. For example:
KEYS BODY SRETURN, F5, F6;.
Conceptually, Return and the KEYS option fkey-list is analogous to a mouse
click and invokes the default production. Shift-Return is analogous to a double-
click and invokes the shift production.
PROTECT
indicates that you cannot access the menu text with the cursor. This option is the
default for a window with a menu and protects text from being accessed by the
cursor.
NOPROTECT
lets you use the cursor to access menu text. This advanced feature allows the
cursor to access the menu text.
SILL
specifies that the window has a sill. A sill is an input area at the foot or base of the
window where you can enter commands and press Return to send them to the
object associated with the window.
Specify SILL for a menu window to allow the sill area to be used to input
commands to the task associated with the menu and the menu body area to be
used as a menu.
NOSILL
NOSILL indicates there should be no input area at the foot of the window. NOSILL
is the default for a menu window.
width-exp
specifies an integer expression that indicates the width in characters of the
window. The width specification includes the left and right character positions
that make up the window frame. A window with a width of three can display
one character per line. Three is the minimum allowable value.
height-exp
specifies an integer expression that indicates the height in characters of the
window. The height includes the head and foot portions of the window. A
window with a height of three can display one line of text at a time. Three is the
minimum allowable value.
*
indicates window width and height as large as possible based on the location
of this window and any preexisting windows on the current page. This option
takes into account the location of other windows on the current page and sizes
this window so that it does not overlap these other windows.
If the value of the width or height expression exceeds the maximum logical size
possible, the window is automatically sized to the maximum possible size for the
window location.
If you specify WINDOW .. SIZE 1000,1000 for a window at a buffer address of
LINE 22,71; the actual size of the window is automatically sized to SIZE 10,3;
which is the maximum size possible for a window whose upper left corner is
located at line 22, column 71 of the screen.
UNTIL target
specifies the height of the window based on the actual contents of the window. The
height of the window is the number of lines from the CACHE target to the UNTIL
target
specifies either text between delimiters, such as /*/ or \stop here\, or a string
expression, such as #s.
If you specify MENU before the UNTIL option, the search is restricted to the text to
the left of the production symbol. If you do not specify MENU or specify it after the
CACHE option, the search includes all characters in the cache.
One use of this option is for sizing popup menus. For example:
Examples
An example of the WINDOW statement follows.
vst911
vst912
vst913
vst915
WITH
The WITH statement indicates which taskid‟s attributes are returned through the
#TASK... intrinsics.
WITH taskid-exp
taskid-exp
specifies an integer expression representing a taskid number whose task attributes
are returned for all subsequent #TASK... intrinsic references.
Considerations
For a complete explanation of each #TASK... intrinsic, see the string intrinsic
definitions in Pound Sign #295.
Examples
These examples show the WITH statement.
WRITE
The WRITE statement writes the specified string to a process or a cache.
taskid
specifies an integer expression that represents the taskid number of the task that
string is to be written to. The WRITE statement automatically synchronizes
script execution to writereads (prompts) from the specified taskid. Any data
previously written or pending from the taskid process is automatically saved to
cache until a WRITEREAD is received from that taskid. When the WRITEREAD is
received, the specified string is written (or replied) to the process represented by
taskid.
For a description of the taskid declaration, see
TASK255.
PEEROK
specifies that the write is a blind write to any process that is a peer to the specified
taskid. Peer tasks are all tasks that have the same $SeeView-process-name
#taskid subdevice opened. Without this option, the SeeView program waits
specifically for a prompt from only the specified taskid.
Note. The script writer assumes the responsibility that use of the PEEROK option
causes a blind write to any peer task that is currently prompting.
string
specifies a string expression that indicates the string to be written to the
process, or cache, indicated by taskid.
The string can be any combination of concatenated quoted strings, integers, and
string variables. (See examples.)
reply-err
specifies an integer expression that indicates an optional reply-error value.
For example, this WRITE statement returns an EOF error to the FUP taskid:
WRITE fup, "", 1;
error
specifies that the result of the WRITE statement is programmatically determined by
setting an integer variable to one of these values:
0 if data was written without an error.
40 if a write timeout occurred; process never prompted. (See the TIMEOUT
option of the
TASK statement.)
-5 if the task has stopped.
-6 if the task has ended abnormally (abended).
CACHE index
stores the string in the cache associated with the taskid rather than actually writing
it to the task in real time. Specifying an asterisk (*) rather than taskid causes the
CACHE option to access the SeeView free window message cache rather than a
taskid cache.
AFTER
indicates that the data defined by string is stored in the cache element
after the CACHE index.
BEFORE
indicates that the data defined by string is stored in the cache element
before the CACHE index.
DELETE
indicates that the element defined by CACHE index is deleted. In this
case, string has no effect, but must be supplied; for example “”.
UPDATE
indicates that the data defined by string is stored in the cache element
defined by the CACHE index. In other words, it updates the defined
CACHE index.
FROM task | *
indicates which cache to write from. If you specify FROM, data from the cache
associated with the specified task is written to the write taskid. FROM
indicates that the WRITE statement string should have up to 32000 bytes of
data from the specified cache appended to it. This provides an efficient way to
return large amounts of information to SeeView requestor tasks.
task
represents a taskid expression whose cache is written to the task specified
by WRITE taskid.
*
indicates that the write should be from the free message cache.
index
specifies the ordinal record index in the cache. CACHE indexes 0, 1, 2, ...,
correspond to the first, second, third, ..., records in cache, and CACHE
indexes -1, -2, -3, ..., correspond to the last, second from last, third from
last,..., records in cache.
FOR lines
indicates the number of cache records to write. If you do not specify FOR, as
many lines as possible are written. Use the LINESENT option to determine the
number of lines actually written.
DELIMIT string
indicates the string delimiter used to delimit the end of each line of cache text
in the blocked message. The default delimiter is a carriage return character,
DELIMIT #CHAR(13). To change it to any desired delimiter string, such as
carriage-return line-feed, specify DELIMIT #CHAR(13) & #CHAR(10).
COMPRESS
is reserved for future use.
LINESENT var
indicates that the symbolic variable represented by var should be set to the
value of the number of lines actually sent. This indicates the number of lines
actually written from cache.
This provides a mechanism for sending multiple blocks of data from a large
cache.
MAXBYTES cnt
indicates the maximum total bytes that can be written from the FROM cache.
The default is 8192. You can increase or decrease the size. The maximum
value cannot be larger than either the configured value of the startup PARAM
POOLPAGES or the WRITE taskid reply buffer size.
MORE string
indicates the string of flag characters to be placed at the start of the buffer if
the reply buffer is full. You can use this option to indicate to the requester that
Otherwise, the response buffer starts with a header string indicating that the
response continues at a given cache index; for example, “TACL status
(continue 000098)”, where 000098 indicates that the response continues at
TACL cache index 98.
This statement returns data from that cache index:
Considerations
The FROM option in conjunction with the PARAM SERVERMODE option allows
workstation clients to make ServerClassSend requests to a SeeView gateway server
and in return receive large, efficiently blocked responses from virtually any HPE
conversational process that the SeeView server has been scripted to allow. This
capability has a variety of applications and advantages in the area of GUI
implementations on workstations. The third example depicts this.
Examples
These examples show the WRITE statement.
?SECT main
{---------}
{ This section loops processing $RECEIVE requests
{------------------------------------------------}
VAR #op; { Server Request
TASK gui := $xxx TIMEOUT 3600,3600; { Timeout in 1 hour
WRITEREAD
The WRITEREAD statement writes a string to the SeeView terminal and returns the
read result in a string variable.
write-string
specifies a string expression indicating the string that is written to the SeeView
terminal #TERMFILENAME. If you do not specify write-string, the
WRITEREAD operation becomes a simple terminal READ operation.
string-var
specifies a string variable to contain the terminal response from the write-
string.
error-var
specifies an integer variable name to contain the file-system error resulting from
the WRITEREAD operation.
When you specify this option, the WRITEREAD operation is not retried by the
SeeView program if an error occurs, and the file-system error is returned in the
specified error variable.
If you do not specify error-var, the operation is under the control of standard
SeeView I/O recovery.
Considerations
This command is for advanced scripting purposes.
Example
This example shows the WRITEREAD statement.
VAR #s
,#esc := #CHAR(27) { Define an escape %33 character}
,#GetRevision := #esc & "_"
{ PCT read full revision level}
;
WRITEREAD #GetRevision, #s; { #s = #C00T0C00}
( expression::= number )
number operator expression
number operator (expression)
operator ::= + - * / MOD AND OR := > < >= <= = <> >> << NOT
Considerations
A designational expression permits integer variable assignment within an expression.
Designational expressions are allowed anywhere expressions are permitted.
Operator type and precedence are as follows:
(boolean) (relational) (arithmetic) (shift)
:= AND OR NOT > < >= <= <> = + - * / MOD >> <<
0 1 1 2 2 2 2 2 2 2 3 3 4 4 4 5 5
Example
This example shows how to use parentheses to specify operator type and precedence.
[ string-or-expression-list ]
string-or-expression-list
specifies a comma-separated list of string and integer expressions that is output
directly to the terminal at the current buffer address. Thus VAR #s:=“Hello”; LINE
10; [#s]; outputs “Hello” at line 10 of the current terminal page.
Example
This example shows how to use the left bracket to delimit the start of a mixed string
and expression list.
VARIABLE esc:=27;
[esc,"o","This text on line25",esc/2]; {note esc/2=13 which is a <CR>
Left Brace {
The left brace delimits an end-of-line comment.
{ comment-text-to-end-of-line
Considerations
The delimited comment remains in effect until the end of the line.
Example
This example shows how to use the left brace to delimit an end of the line comment.
VARIABLE esc:=27;
[esc,"o","This text on line25",esc/2]; {note esc/2=13 which is a <CR>
Quotation Mark “
A statement beginning with a quotation mark indicates the beginning of a string of data
to be written directly to the terminal device defined by the SeeView program output file.
#s := "CALL myproc('FUP','INFO')";
#s := "CALL myproc(" & """ & "FUP" & """ & "," & """ & "INFO" & """ & ")";
Example
This example shows how to use quotation mark script symbols.
VAR lineno := 0
, #s := "thistextgetsdropped ( Msg on line 25 )"
;
DO BEGIN
LINE lineno:=lineno+1;
"Line " & lineno;
END UNTIL lineno >= 24;
MSG #DROP #s; { Line25 = ( Msg on line 25 )
Pound Sign #
The pound sign or octomorph can either mark the beginning of a string-assignment
statement or delimit a string variable (string-var), string intrinsic, or string operator.
#string-variable
indicates the beginning of a string-replacement statement when it appears as the
first character of a SeeView statement. For example:
&
specifies that strings are to be concatenated. & indicates string concatenation.
index-range
specifies that the string index range of [beginchar : endchar] returns
characters beginchar through endchar of a string variable or string intrinsic.
For convenience, when endchar is beyond the end of the current length of a
string, only the characters up to the end of the string are returned. Thus, if
#S:="12345678" then #S[6:132] returns "678" and is equivalent to
#S[ 6:#SIZE #S].
string-operator
works on string variables and string intrinsics. String operations either return
information or operate on the string variable or string intrinsic. For example, the
variable #S:=“SeeView Features”; has a length of 16 bytes. Thus #SIZE #S =
“16”. The operator #SIZE returns information by operating on #S to determine
its size. Some string operators modify the string. For example, #TRIM #S
returns “SeeView”, but also changes the contents of #S to be “Features”.
string-intrinsic
returns information about the entity that it represents, such as #DATE and
#TIME. Contrast this with string operators that return information about the
contents of a string variable; for example, #SIZE #TIME.
Example
This example shows how to use the pound sign script symbol.
String Operators
String operators work on string variables and string intrinsics. They either return
information or operate on the string variable or string intrinsic.
#CHAR expression
returns the right byte of an integer expression as a type string. This example
displays ASCII characters 32 .. 95:
VAR i:=31;
FOR 3 DO BEGIN { show chars 32 .. 95
LINE i/32+1;
FOR 32 DO [ #char(i:=i+1) ];
END;
VAR #s : = "$TERM";
MSG #DEVICEINFO #s; {displays 0 6 4 80
VAR #s : = "$DATA.SUBVOL.NAMETOOLONG";
MSG #DEVICEINFO #s {displays 13 0 0 132,
{ where error = 13 implies illegal filename.
VAR #s:="$DATA.MYVOL.X";
MSG #INFO #s; { displays
0000 0100 255,255 NUNU $DATA.MYVOL.X
ferr fcode grp, user rwep file
VAR #s:="*";
MSG #NODE #s; { displays
{ 51 \CHICAGO 3/4 D40
VAR #s : ="A";
MSG #ORD #s; {displays 65
VAR #s:="SEEPROMPT";
MSG #PROC #s; { displays
$SYSTEM.SYSTEM.SEESHELL
TASK tacl;
VAR #s:="TACL";
MSG #TASK #s; { displays "1"
#TRIM #string-var
specifies #TAKE and #DROP for the first token in #string-var.
In this example, #TRIM returns the first token in the string variable #s and removes
that token from the contents of the string variable.
#CACHEFREE
returns the number of free cache memory pages currently available for new user
tasks and menus. Cache pages are used when tasks or menus are declared.
One use of this intrinsic is to determine whether enough free pages remain to
declare a task with a large cache. For example:
#CACHEPAGES
returns the total number of cache memory pages configured for the current
SeeView environment. It includes both used pages and free pages. Use PARAM
CACHEPAGES to configure SeeView cache size at startup time. (See Appendix
A: Running the SeeView Program.)
#CREATORUSERID
returns a string containing the SeeView process creator security group and user ID
numbers. The information is returned in "GGG,UUU" format, where:
GGG is the security group number.
UUU is the security user number.
One use of this intrinsic is to determine the creator security group and user ID
numbers for authentication purposes. For example:
#CREATORUSERNAME
returns a string containing the security group and user name of the SeeView
creator access ID. Values are returned in GroupName.UserName format, where:
GroupName ::= creator security group name such as SUPER.
UserName ::=creator security user name such as OPERATOR.
#DATE
returns a string containing the current date and time in YY/MM/DD HH:MM:SS format,
where:
#FIRMID
returns a string containing the firmware ID (for example, A, B, C, D, ..) of the
current SeeView terminal. The terminal firmware ID identifies the version of
firmware (or software for PC emulators) for the current T6500 terminal or emulator.
#FKEY
returns the numeric value of the last function key pressed, where F1 to F16
correspond to values of 1 to 16 and SF1 to SF16 correspond to values of 17 to 32.
Nonnumeric function keys correspond to values of 33 to 47. You can test
nonnumeric function keys such as Roll-Up, Roll-Down, and Return, with FKEY...
intrinsics, such as #FKEYROLLUP, #FKEYROLLDOWN, and #FKEYRETURN.
#FKEYDELETELINE
returns a unique nonzero numeric value (45) if the last function key pressed was
the Delete-Line key. If the last function key pressed was not the Delete-Line key,
the value returned is zero. (This lets you use the intrinsic as a Boolean.)
#FKEYINSERTLINE
returns a unique nonzero numeric value (37) if the last function key pressed was
the Insert-Line key. If the last function key pressed was not this key, the value
returned is zero. (This lets you use the intrinsic as a Boolean.)
#FKEYLINE
returns the line number of the cursor when a function key (for example, #FKEY or
#FKEYRETURN) was last pressed. The value of #FKEYLINE ranges from 1
through 24.
One use of this intrinsic is to programmatically move the cursor relative to the last
cursor position when a function key is pressed. For example:
#FKEYNEXTPAGE
returns a unique nonzero numeric value (35) if the last function key pressed was
the Next-Page key. If the last function key pressed was not this key, the value
returned is zero. (This lets you use the intrinsic as a Boolean.)
#FKEYPREVPAGE
returns a unique nonzero numeric value (36) if the last function key pressed was
the Prev-Page key. If the last function key pressed was not this key, the value
returned is zero. (This lets you use the intrinsic as a Boolean.)
#FKEYROLLDOWN
returns a unique nonzero numeric value (34) if the last function key pressed was
the Roll-Down key. If the last function key pressed was not this key, the value
returned is zero. (This lets you use the intrinsic as a Boolean.)
#FKEYROLLUP
returns a unique nonzero numeric value (33) if the last function key pressed was
the Roll-Up key. If the last function key pressed was not this key, the value
returned is zero. (This lets you use the intrinsic as a Boolean.)
#FKEYSNEXTPAGE
returns a unique nonzero numeric value (43) if the last function key pressed was
the Shift-Next-Page key. If the last function key pressed was not this key, the value
returned is zero. (This lets you use the intrinsic as a Boolean.)
#FKEYSPREVPAGE
returns a unique nonzero numeric value (44) if the last function key pressed was
the Shift-Prev-Page key. If the last function key pressed was not this key, the value
returned is zero. (This lets you use the intrinsic as a Boolean.)
#FKEYSRETURN
returns a unique nonzero numeric value (47) if the last function key pressed was
the Shift-Return key. If the last function key pressed was not this key, the value
returned is zero. (This lets you use the intrinsic as a Boolean.)
#FKEYSROLLDOWN
returns a unique nonzero numeric value (42) if the last function key pressed was
the Shift-Roll-Down key. If the last function key pressed was not this key, the value
returned is zero. (This lets you use the intrinsic as a Boolean.)
#FKEYSROLLUP
returns a unique nonzero numeric value (41) if the last function key pressed was
the Shift-Roll-Up key. If the last function key pressed was not this key, the value
returned is zero. (This lets you use the intrinsic as a Boolean.)
LINE #FKEYLINE,#FKEYCOL;
VIDEO [ #FVBODY ]; { restore video to normal
#FVMENUBODY
returns the numeric value of the video attributes for the body portion of all menus
in the current SeeView environment. The
VIDEO statement accepts a numeric specification for video attributes. For
example:
VIDEO [#FVMENUBODY];
One way you can use this intrinsic is to restore video in the body of a menu to
normal; for example, to turn off video highlighting.
#LASTPAGE
returns the numeric value of the last user page for the current SeeView
environment. This value is equal to the total number of user pages. The number of
user pages varies depending upon the type of terminal that the SeeView program
has opened. You can also manually configure the total number of user pages by
using the PARAM LASTPAGE option. (See Appendix A: Running the SeeView
Program.)
To programmatically access the Help page:
PAGE #LASTPAGE + 1;
#MENUCACHEFILE
returns the name of the file contained in the cache associated with the last
referenced window. The window can be a nonmenu and can even be an edit-mode
window.
You can use this intrinsic to save the contents of a cache to the file from which it
was loaded. For example:
#MENUCACHELINEPTR
returns the ordinal cache record number (from 0 to n) of the line of text where the
cursor was located in the window that invoked this script. You invoke a script with
Return, Shift-Return, or any of the function keys in the WINDOW statement KEYS
fkey-list. This record in cache corresponds to the cursor position when a line
of text is selected.
You can use this intrinsic is programmatically operate on a selected line of cache
in the window just referenced. For example, to change the word pointed to by the
current cursor position to uppercase:
#MENUCOL
returns the screen column number of the left edge of the window that invoked this
script. You invoke a script with Return, Shift-Return, or any of the function keys in
the WINDOW statement KEYS fkey-list. Screen column numbers range from 1
through 80.
You can use this intrinsic to calculate screen locations relative to the most recently
referenced window.
To specify the screen location beside the current menu:
#MENUEDITMODE
returns 1 if the invoking window is in edit mode. Otherwise it returns 0. This
intrinsic helps you determine whether the invoking window is in edit mode so that
the script can possibly provide additional editing operations.
#MENUHEADING
returns a string that contains the current user-defined heading for the window that
invoked this script. You invoke a script with Return, Shift-Return, or any of the
function keys in the WINDOW statement KEYS fkey-list.
You can use this intrinsic to repaint the last referenced window with the same
heading. For example:
#MENUHEIGHT
returns a numeric value representing the height of the window that invoked this
script. You invoke a script with Return, Shift-Return, or any of the function keys in
the WINDOW statement KEYS fkey-list.
You can use this intrinsic is to repaint the last referenced window with the same
size. For example:
#MENUINPUT
returns a string containing the user input text in response to a prompt production
input field for the last referenced menu. You reference a menu prompt production
with a Return or Shift-Return key.
You can use this intrinsic to obtain user input in response to a prompt production
input field. For example:
?MENU MyMenu
Enter Filename:[ ] <==? CALL FileInfo ( #MENUINPUT )
?SECT Main
LINE 4;
WINDOW MyMenu MENU CACHE FIRST size 30,3;
?SECT TaclWindow
{---------------}
{ Display a tacl window that passes F16
{ through to TACL. So that user can get TACL
{ help by typing on the SILL and pressing F16.
{--------------------------------------------}
PAGE #LASTPAGE;
TASK TACL;
WINDOW TACL CACHE LL KEYS SILL F16
PRODUCTION "CALL PassFkeyCmd(Tacl)";
?PROC PassFkeyCmd(tid);
{---------------------}
{ Pass fkey pressed to taskid=tid along with cmd on the sill
{ Note that the task expects the terminal fkey data stream,
{ so we must build the <SOH> <fkey> <row> <col> data stream.
{-----------------------------------------------------------}
PARM tid;
VAR #s
, #fkeyTransform:= "@ABCDEFGHIJKLMNO" & { f1..f16
"'abcdefghijklmno" & { sf1..sf16
"PQRSTUVW" & "pqrstuv" { others
, #fk:=#char(1) & { <soh>
#fkeyTransform[#fkey] & { <fkey> code
#char(32+0) & { <row>
#char(32+#fkeycol-#menucol-1) { <column>
;
WITH tid; { pickup old prompt
#s := #TASKPROMPT & #MENUINPUT; { #menuinput is sill input
WRITE tid, #MENUINPUT & #fk; { write cmd & fkey to tid
WRITE tid CACHE -1 UPDATE,#s; { suppress #fk in cache
LINE #MENULINE,#MENUCOL; { update window
#MENULINE
returns the screen line number of the top edge of the window that invoked this
script. You invoke a script with Return, Shift-Return, or any of the function keys in
the WINDOW statement KEYS fkey-list. Screen line numbers range from 1
through 24.
You can use this intrinsic to calculate screen locations relative to the most recently
referenced window or, for example, to redisplay the window at the same location
as the current window.
#MENUOBJECT
returns a string containing the window attributes of the last referenced window that
invoked the script. You invoke a script with Return, Shift-Return, or any of the
function keys in the WINDOW statement KEYS fkey-list. Attributes are
returned, such as MENU, EDIT, GLASS, SILL, and so on.
#MENUPRODUCTION
returns a string containing the default production of the window that invoked this
script. You invoke a script with Return, Shift-Return, or any of the function keys in
the WINDOW statement KEYS fkey-list. The default production is the script
production that is associated with a window by using the MENU or PRODUCTION
options of the WINDOW statement.
If a window does not have a default production associated with it, the intrinsic
#MENUPRODUCTION equals the null string “”. For additional information
regarding productions, see the WINDOW statement MENU and PRODUCTION
options.
You can use this intrinsic to reassert the same default production when repainting
the current window. For example:
#MENUPRODUCTION2
returns a string containing the shift production of the window that invoked this
script. You invoke a script with Return, Shift-Return, or any of the function keys in
the WINDOW statement KEYS fkey-list. The shift production is the production
script that is executed when you press Shift-Return.
A window may not have a shift production associated with it, in which case the
intrinsic #MENUPRODUCTION2 equals the null string “”. See the WINDOW
statement MENU and PRODUCTION options for additional information regarding
shift productions.
One way you can use this intrinsic is to reassert the same shift production when
repainting the current window. For example:
IF NextTargetLine>=0 THEN
WINDOW #MENUTASKID MENU CACHE INDEX NextTargetLine NOFRAME;
ELSE
MSG "No more occurrences of " & #target;
#MENUTEXT
returns a string containing the line of text referenced by the cursor in the window
that invoked this script. You invoke a script with Return, Shift-Return, or any of the
function keys in the WINDOW statement KEYS fkey-list. #MENUTEXT returns
only the text to the left of the production symbol and does not include the
production script to be executed if one is present.
This intrinsic is often used to pass information contained in the selected line of
window text to a procedure associated with the window. For example:
?MENU MyMenu
Disc
Tape
Printer
?SECT ShowMenu
LINE 4;
WINDOW MyMenu MENU "CALL ListDev ( #MENUTEXT )" SIZE 12,5;
#MENUTOKEN
returns a string containing the token pointed to by the cursor in the window that
invoked this script. You invoke a script with Return, Shift-Return, or any of the
function keys in the WINDOW statement KEYS fkey-list.
Use this intrinsic in windows that have unprotected text to allow a user to point at
specific tokens in the window text.
You can point the cursor to any character in the token, and this intrinsic returns the
entire token (a token in this case being characters bound on either side by blanks).
For an example, see the #MENUCACHELINEPTR option in this subsection.309
#MENUTOKENINDEX
returns a numeric value representing the character index of the first character of
the #MENUTOKEN in the #MENUTEXT of the window that invoked this script. You
invoke a script with Return, Shift-Return, or any of the function keys in the
WINDOW statement KEYS fkey-list.
Use this intrinsic in windows that have unprotected text. It allows users to point at
specific tokens in the window text. You can point the cursor to any character in the
token, and the intrinsic returns the first character position of the #MENUTOKEN.
For an example, see the #MENUCACHELINEPTR option in this subsection.
#MENUWIDTH
returns a numeric value representing the width in characters of the window that
invoked this script. You invoke a script with Return, Shift-Return, or any of the
function keys in the WINDOW statement KEYS fkey-list.
You can use this intrinsic to repaint the last referenced window with the same size.
For example:
#MYPROCESSNAME
returns a string containing the process name of the current SeeView process. You
can use this intrinsic to pass the SeeView process name to another process so
that the other process opens the SeeView program.
This example starts up an Event Management Service (EMS) printing distributor
that logs EMS events to the SeeView program that started it:
#PAGE
returns a numeric value representing the current terminal page number. Values
returned range from 1 through #LASTPAGE+1, where #LASTPAGE is the last user
terminal page, and #LASTPAGE+1 is the Help page.
You can use this intrinsic to step through terminal pages relative to the current
page. For example:
#PAGESFREE
returns a string containing a list of integer numbers that represent terminal page
numbers that have no windows on them. For example, if there are seven user
pages, and windows are on terminal pages 1, 3, and 4, the #PAGESFREE intrinsic
returns “2 5 6 7”.
You can use this intrinsic is to find the lowest numbered unused terminal page in
the current environment. For example:
#PAGESUSED
returns a string containing a list of integer numbers that represent terminal page
numbers that have windows on them. For example if there are seven user pages,
and windows are on terminal pages 1, 3, and 4, the #PAGESUSED intrinsic
returns “1 3 4”.
You can use this intrinsic is to display each terminal page in the current
environment that has one or more windows on it.
For example:
?proc ShowPages
{--------------}
{ Flip to next used page every 3 seconds.
{ Force windows to auto refresh by using WAIT 3,REFRESH
{------------------------------------------------------}
#PRODNAME
returns a string containing the name of the SeeView product. The standard
SeeShell uses this intrinsic.
#PRODNUM
returns a string containing the HPE part number for the SeeView product. The
standard SeeShell uses this intrinsic.
#REVISION
returns a string containing the revision date of the current SeeView product. The
format of the revision date is in (ddMMMyy) format where dd is day, MMM is month,
yy is year. The standard SeeShell uses this intrinsic.
#SERVERMODE
returns a string containing the numeric value 0, 1, 2, ... of the PARAM
SERVERMODE mode specified at startup time.
You can use this intrinsic to programmatically determine whether the current
SeeView program is running as a server or as an interactive process. For example:
#SHELL
returns a string containing the name of the current SHELL defined to the SeeView
program. This name can be either a file name (for example,
“$SYSTEM.SYSTEM.SEESHELL”) or a cache name (such as “CACHE
MYSHELL”).
You can use this intrinsic to programmatically reshell the current shell. For
example:
#TASKCACHEFILE
returns the name of the file contained in the cache associated with the current
WITH taskid. The WITH statement indicates which taskid‟s attributes are
returned by the #TASK ... intrinsics. If the cache was not loaded using the SEEDIT
GET command, #TASKCACHEFILE equals the null “” string.
You can use this intrinsic is to determine the files currently being edited in the
SeeView environment. For example:
?MENU files
?SECT main
DELETE files!;
VAR tid:=-1;
FOR #TASKCOUNT DO BEGIN
WITH tid:=tid+1;
IF #TASKCACHEFILE<>"" THEN
PUSH #TASKSYMBOL & " = " & #TASKCACHEFILE onto files;
END;
LINE 4;
WINDOW files CACHE FIRST;
#TASKCACHEFREE
returns a numeric value representing the number of free cache memory pages for
the cache associated with the current WITH taskid. The WITH statement
indicates which taskid‟s attributes are returned by the #TASK... intrinsics.
You can use this intrinsic to determine the actual number of cache pages in use by
the current WITH taskid. For example:
WITH taskid;
PagesUsed := #TASKCACHEPAGES - #TASKCACHEFREE;
#TASKCACHELINES
returns a numeric value representing the number of text lines contained in the
cache associated with the current WITH taskid. The WITH statement indicates
which taskid‟s attributes are returned by the #TASK... intrinsics.
You can use this intrinsic to make the height of a window equal to the number of
lines in the cache for that window. For example:
?MENU devices
?SECT main
CALL ShowDevices ("DISC");
#TASKCACHEPAGES
returns a numeric value representing the number of cache memory pages
allocated for the cache associated with the current WITH taskid. The WITH
WITH mydata;
IF #TASKCACHEPAGES < PagesNeeded THEN
MSG "Not enough room to load data"
ELSE BEGIN
DELETE mydata!;
LOAD $vol.subvol.data , mydata;
END;
#TASKCOL
returns a numeric value representing the screen column number of the left edge of
a window on the current WITH taskid. Screen column numbers range from 1
through 80. The WITH statement indicates which taskid‟s attributes are returned by
the #TASK... intrinsics.
You can use this intrinsic to determine where a window is located for a given
taskid. For an example, see the #TASKCACHELINE option in this subsection318.
#TASKCOUNT
returns a numeric value representing the maximum number of tasks ever declared.
The intrinsic does not require a WITH statement to take effect. You can use this
intrinsic to iterate through all taskids checking for a certain condition.
For example, this example shows a menu of all taskids that have a task symbol
and a running process associated with them.
?MENU MyMenu
?PROC ShowTaskids
{----------------}
{ Display a menu of taskids that are running
{-------------------------------------}
VAR i; {note initial value is -1
DELETE MyMenu!;
FOR #TASKCOUNT DO BEGIN
WITH i:=i+1;
IF (#TASKSYMBOL<>"") AND (NOT #TASKSTOPPED) THEN
PUSH #TASKSYMBOL ONTO MyMenu;
END;
BELOW;
WITH MyMenu;
IF NOT #TASKCACHELINES THEN BEGIN
MSG(R) "No tasks to display !!";
RETURN;
END;
WINDOW MyMenu SIZE 15,#TASKCACHELINES+2;
TASK FUP;
TASK TACL;
WITH FUP;
WINDOW TACL,"STATUS " & #TASKCPU;
#TASKDATA
returns a string containing the last data received from the current WITH taskid.
The WITH statement indicates which task ID‟s attributes are returned by the
#TASK... intrinsics.
You can use this intrinsic to programmatically inspect the data returned from a
taskid. For example:
TASK netmon;
WRITE netmon, "cpus";
WITH netmon;
DO BEGIN
READ netmon;
IF #NUMERIC #TASKDATA THEN BEGIN { have node data
node := #TAKE #TASKDATA;
..
..
END;
END UNTIL #TASKPROMPTING;
#TASKEDITMODE
returns a numeric value representing the page number where a window is in edit
mode for the current WITH taskid. If there are no windows in edit mode for the
current WITH taskid, zero is returned so that you can use the intrinsic as a
Boolean. The WITH statement indicates which task ID‟s attributes are returned by
the #TASK... intrinsics.
You can use this intrinsic to programmatically determine if and where there is a
window in edit mode for a given taskid. For example:
#TASKERROR
returns error information about the last TASK statement executed with an
ALLOWERROR option. The value returned depends on which process creation
procedure was used in the last TASK statement.
If NEWPROCESS was used in the last TASK statement, the value of the
#TASKERROR intrinsic is the value of bits <8:15> of the ERROR parameter
returned by the Guardian procedure call NEWPROCESS.
If PROCESS_CREATE_ was used in the last TASK statement, the value of the
#TASKERROR intrinsic is the value of the ERROR^DETAIL parameter returned by
the Guardian procedure call PROCESS_CREATE_.
This intrinsic does not require a WITH statement to have meaning.
The ALTER HIGHPINTASKS ON/OFF option controls whether the Guardian
PROCESS_CREATE_ or NEWPROCESS procedure is used for process creation.
If you want PROCESS_CREATE_ to be used, specify HIGHPIN ON. If you want
NEWPROCESS to be used, specify HIGHPIN OFF.
The intrinsic #TASKPROC returns the name of the procedure that was used in the
last task statement. The error codes returned by #TASKERRORTYPE and
#TASKERROR depend on which procedure was used to launch the process. For
information on error codes returned, see the GUARDIAN Procedure Calls
PROCESS_CREATE_ and NEWPROCESS. You use the #TASKERRORTYPE
and #TASKERROR intrinsics to programmatically determine if a TASK statement
executed successfully. For example:
#TASKERRORTYPE
returns error information about the last TASK statement executed with an
ALLOWERROR option. The value returned depends on which process creation
procedure was used in the last TASK statement.
If NEWPROCESS was used in the last TASK statement, the value of the
#TASKERRORTYPE intrinsic is the value of bits <0:7> of the ERROR parameter
returned by the Guardian procedure call NEWPROCESS.
#TASKHEIGHT
returns a numeric value representing the height of a window on the current WITH
taskid. The WITH statement indicates which taskid‟s attributes are returned by
the #TASK... intrinsics.
You can use this intrinsic to determine the size of a window for a given taskid. For
an example, see the #TASKCACHELINE option in this subsection318.
#TASKID
returns a numeric value representing the taskid number of the current WITH
taskid. The WITH statement indicates which taskid‟s attributes are returned by
the #TASK... intrinsics.
You can use this intrinsic to write general code when it is desirable to not be
concerned with the current taskid variable name. For example:
PAGE #TASKPAGENO;
LINE #TASKLINE, #TASKCOL;
WINDOW #TASKID SIZE #TASKWIDTH, #TASKHEIGHT;
#TASKLINE
returns a numeric value representing the screen line number of the top edge of a
window on the WITH taskid. Screen line numbers range from 1 through 24. The
WITH statement indicates which taskid‟s attributes are returned by the #TASK...
intrinsics.
You can use this intrinsic to determine where a window is located for a given
taskid. For an example, see #TASKCACHELINE in this subsection318.
#TASKMENU
returns a string containing the file or cache name of the script that declared the
current WITH taskid if the taskid was declared by a ?MENU taskid interpreter
directive. The WITH statement indicates which taskid‟s attributes are returned by
the #TASK... intrinsics.
If the current WITH taskid was declared with a TASK statement, #TASKMENU
returns the null string “”.
The intrinsic tells whether the current WITH taskid was declared with a TASK
statement (for example, #TASKMENU=“”) or with a ?MENU directive (for example,
#TASKMENU=“$SYSTEM.SYSTEM.SEESHELL”, indicating the file or cache
name where the menu was declared). #TASKMENU contains the file or cache
name where it came from.
You can use this intrinsic to determine the script file name that declared a given
?MENU taskid.
This example invokes the script that declared the last referenced menu:
WITH #MENUTASKID;
IF #TASKMENU<>"" THEN BEGIN {invoke script that built menu
EXECUTE "INVOKE " & #TASKMENU;
END;
#TASKMSGSLASTREAD
returns the number of logical messages in the last I/O block received for the
current WITH statement. The WITH statement indicates which taskid‟s attributes
are returned by the #TASK ... intrinsics.
This feature supports the SeeView Server Gateway and enables a script to
efficiently process BLOCKEDIO messages received from a task.
In this example, messages are processed in FIFO order as they were received in
the last I/O block read.
VAR #s, i;
TASK request:=$OPS BLOCKEDIO ON;
TASK TACL;
DO BEGIN
READ request,#s;
WITH request;
i :=#TASKMSGSLASTREAD;
FOR #TASKMSGSLASTREAD DO BEGIN
READ request cache -(i),#s;
WRITE TACL,#s;
i:=i-1;
END;
END UNTIL 1;
#TASKOBJECTNAME
returns a string containing the file name of the current WITH taskid. If you
declared the WITH taskid with a
TASK statement, the file name returned is the program object file name on disk.
Otherwise, the name returned is a pseudo process name. The WITH taskid
indicates which taskid‟s attributes are returned by the #TASK... intrinsics.
#TASKPAGENO
returns a numeric value representing the terminal page number where a window
exists for the current WITH taskid. If no windows exist for the current WITH
taskid, zero is returned so that you can use the intrinsic as a Boolean. The WITH
statement indicates which taskid‟s attributes are returned by the #TASK...
intrinsics.
WITH fup;
IF NOT #TASKPAGENO THEN BEGIN
MSG "No window exists for " & #TASKSYMBOL;
RETURN;
END;
PAGE #TASKPAGENO;
#TASKPEERS
returns a string representing the number of peer tasks associated with the current
WITH taskid. If there are no peers, the value returned is zero. The WITH
taskid statement indicates which taskid‟s attributes are returned by the
#TASKPEERS intrinsic.
Peer tasks share the same cache. For example, within SeeView, a FUP started
from a TACL is a peer to TACL. Both tasks share the same virtual memory cache.
#TASKPID
returns a string containing the process ID of the current WITH taskid. The WITH
taskid indicates which taskid‟s attributes are returned by the #TASK... intrinsics.
You can use this intrinsic to pass the process ID of the current WITH taskid to
another process.
#TASKPIN
returns a string containing the process identification number (PIN) of the current
WITH taskid. The WITH taskid indicates which task ID's attributes are returned
by the #TASK... intrinsics. One use of this intrinsic is to determine the PIN of the
current WITH taskid. For example, this displays TACL status for the process
associated with the current WITH taskid.
TASK FUP;
TASK TACL;
WITH FUP;
WINDOW TACL,"STATUS " & #TASKCPU & "," & #TASKPIN;
#TASKPROC
returns the name of the Guardian procedure (NEWPROCESS or
PROCESS_CREATE_) used to launch processes with the most recent RUN,
OPEN, or TASK statement. This intrinsic is useful in interpreting error codes
returned by the intrinsics #TASKERRORTYPE and #TASKERROR because the
values returned depend on which procedure was used to launch the process. For
information on error codes returned by the procedures PROCESS_CREATE_ and
NEWPROCESS, see the Guardian Procedure Calls Reference Manual. This
#TASKPROMPT
returns a string containing the actual prompt text from the current WITH taskid.
The WITH taskid indicates which taskid‟s attributes are returned by the #TASK...
intrinsics.
You can use this intrinsic is to check the current WITH taskid prompt text in
order to determine the state of the task. For example:
TASK fup;
WITH fup;
DO BEGIN { Wait until task is prompting, then test prompt.
READ fup;
END UNTIL #TASKPROMPTING;
#TASKPROMPTING
returns a numeric value representing the maximum read length in bytes of the
prompt associated with the current WITH taskid. The WITH statement indicates
which task ID‟s attributes are returned by the #TASK... intrinsics. If the current
WITH taskid is not prompting, #TASKPROMPTING returns 0 so that you can use
this intrinsic as a Boolean. For an example, see #TASKPROMPT.
#TASKSECONDS
returns a string representing the number of seconds since the current WITH
taskid was started or stopped. You can use the WITH taskid statement to
specify which task ID‟s attributes are returned by the #TASK... intrinsics. You can
use the #TASKSTOPPED intrinsic to determine whether a task is currently
stopped or running. If the number of seconds is greater than 32766,
#TASKSECONDS returns 32766.
#TASKSTOPPED
returns a numeric value that indicates whether the current WITH taskid is
stopped. Zero is returned if the current WITH task is not stopped so that you can
use this intrinsic as a Boolean.
A nonzero value is returned if the current WITH task is stopped. Nonzero values
correspond to the reason for the stopped state. A -5 indicates a normal STOP
state, and -6 indicates an abnormal ABEND state.
The WITH taskid statement indicates which taskid‟s attributes are returned by
the #TASK... intrinsics.
You can use this intrinsic to test the state of a taskid variable prior to attempting
interprocess communication with that task by using a
WITH tacl;
IF #TASKSTOPPED THEN CALL StartTacl;
WRITE tacl, #command;
#TASKSYMBOL
returns a string containing the symbolic name of the current WITH taskid
variable. The WITH taskid statement indicates which taskid‟s attributes are
returned by the #TASK... intrinsics.
You can use this intrinsic to display the name of a task when generalized WITH
taskid logic is used. For example:
#TASKTIMESTAMP
returns a string representing the date and time that the current WITH taskid was
started or stopped. You can use the WITH taskid statement to specify which
taskid‟s attributes are returned by the #TASKTIMESTAMP intrinsic. The format of
the data returned is YY/MM/DD HH:MM:SS. You can use the #TASKSTOPPED
intrinsic to determine whether a task is currently stopped or running.
#TASKUSERID
returns a string containing the security group and user ID for the current WITH
taskid. The WITH statement indicates which taskid's attributes are returned by
#TASK... intrinsics. The values are returned in GGG,UUU format, where:
GGG is the security group number.
UUU is the security user number.
Use this intrinsic to determine the security user ID associated with any SeeView
TASK variable. For example, this example returns the security group and user ID
of the FUP task that has SeeView opened.
WITH FUP;
Var #GrpNo := #TASKUSERID[1:3];
#TASKUSERNAME
returns a string containing the security group and user name for the current WITH
taskid. The WITH statement indicates which taskid's attributes are returned by
the #TASK... intrinsics. Values are returned in GroupName.UserName format,
where:
GroupName ::= security group name such as SUPER.
UserName ::= security user name such as OPERATOR.
This example shows how this intrinsic might be used to determine the security
group or user name associated with a TASK variable:
WITH FUP;
Var #GrpName:=#TAKE #TASKUSERNAME;
Var #UsrName:=#TAKE #TASKUSERNAME[#SIZE #GrpName+2:132];
IF #GrpName = "SUPER" THEN MSG "FUP accessorid is in SUPER group";
#TASKWIDTH
returns a numeric value representing the width of a window on the current WITH
taskid. The WITH statement indicates which taskid‟s attributes are returned by
the #TASK... intrinsics.
You can use this intrinsic to determine the size of a window for a given taskid.
For an example, see #TASKCACHELINE in this subsection318.
#TERMFILENAME
returns a string containing the NonStop file name of the current SeeView terminal.
You can use this intrinsic to inform an external user, or program, of the name of
the SeeView terminal. For example:
#TERMFILENAMEOLD
returns a string containing the file name of the SeeView terminal prior to the last
connect operation. If no prior connect has been performed by this SeeView, the
intrinsic returns the null string.
You can use this intrinsic to reconnect SeeView to the terminal where it was
previously connected. For example:
TASK SEEDIT;
WITH SEEDIT;
IF NOT #TASKSTART THEN
IF NOT #TASKPROMPTING THEN BREAK SEEDIT;
#TERMID
returns a string that represents the terminal type of the current SeeView terminal.
Terminal types correspond to the following product numbers: T6530, T6526,
T6540 (PCT), and so on.
This intrinsic is often used when terminal dependent scripts are being written; for
example, COLOR for the T6540 PC emulator program. For example:
#TIME
returns a string containing the current time in HH:MM:SS format, where:
HH is local civil hour (00..23).
MM is minutes (00..59).
SS is seconds (00..59).
#TIMERCPUMS
returns the CPU process busy time in milliseconds since ALTER STATISTICS ON
or the last function key was pressed.
Note. The returned value is a string representation of the 32-bit value and might not
be suitable for 16-bit computation.
#TIMERCPUSECS
returns the CPU process busy time in seconds since ALTER STATISTICS ON or
the last function key was pressed.
Note. The returned value is a string representation of the 32-bit value and might not
be suitable for 16-bit computation.
#TIMERMS
returns the elapsed time in milliseconds since ALTER STATISTICS ON or the last
function key was pressed.
TIMERSECS
returns the elapsed time in seconds since ALTER STATISTICS ON or the last
function key was pressed.
Note. The returned value is a string representation of the 32-bit value and might not
be suitable for 16-bit computation.
#TIMEMINUTES
returns a string containing the current time of day in minutes since midnight. You
can use this intrinsic to determine the elapsed time in minutes between two time
samples. For example:
#TIMETENSECONDS
returns a string containing the current time of day in decaseconds since midnight.
#TOSVERSION
returns a string containing the current operating system Vnn product version.
V represents the letter version of the operating system.
represents the current number version.
Nn
#USERID
returns a string containing the security group and user ID for the current SeeView
process. The values are returned in GGG,UUU format, where:
GGG is the group number.
UUU is the user number.
This intrinsic can be used to determine the security group and user accessor ID of
the SeeView process running the current script:
#VERSION
returns a string containing the product version of the current SeeView process.
The format of the product version information returned is in Vnn format, where V is
a letter representing the general release version, and nn is a number representing
the specific release level, for example, D10 or D20.
This example returns: “Seeview T6965D20 (01MAR97)”.
MSG #PRODNAME & " " & #PRODNUM & #VERSION & " " & #REVISION;
#VERSIONIPM
returns a string containing the software product revision (SPR) of the current
SeeView process. The SPR information returned is in “aaa” format, where “aaa”
are letters representing the SPR, such as AAA, AAB, and so on.
The following example returns “SeeView D20 AAA”.
MSG #PRODNAME & " " & #VERSION & " " & #VERSIONIPM;
#VOLSUB
returns a string containing the current default volume and subvolume for the
SeeView process. You can alter the value of this intrinsic with the ALTER
VOLUME statement.
You can use this intrinsic to refer to the name of a file located on the current
default subvolume. For example:
#VOLSUBOBJECT
returns a string containing the current volume and subvolume of the SeeView
object file. Use this intrinsic when you want to refer to the subvolume where the
SeeView object and associated files are located.
Note. The contents of the SEECSTM, SEELOCL, and SEENET files are meant to serve
as examples only. You can customize these files to fit your own environment.
NAME pid
specifies the process name of the SeeView program.
The SeeView program name must have no more than four characters (not
including the dollar sign, $).
OUT file
specifies the terminal that the SeeView program opens.
option
specifies any standard TACL run option. For a description of the standard TACL
run options, see the TACL Reference Manual.
statement
specifies one or more SeeView statements described in Section 9: SeeView
Statements and Script Symbols.
Startup Values
The SeeView program has several default settings that you can change before
SeeView startup. Enter the statements at the TACL prompt before starting the
SeeView program.
PARAM CACHE cache-pages: This parameter specifies the total size of the
cache pool used by the SeeView program to hold individual tasks‟ caches. The
cache pool is allocated evenly among the total number of task control blocks
available unless a task or ?MENU statement specifies another value with the
CACHEPAGES option. Thus, normally each ?MENU or task gets an equal
fractional amount of the total cache pages available when it is declared.
The value passed in this PARAM cache-pages is a value in pages. Each cache
page is 2048 bytes in size, and the default is 2048 pages (which is split up among
all your tasks).
PARAM EXTENSIBLE cache-pages: This parameter defines the total number
of memory pages allocated for user task caches and symbols. PARAM
EXTENSIBLE allocates an extensible cache segment for SeeView cache so that
disk space for cache memory pages is allocated only as needed.
If you specify PARAM EXTENSIBLE extensible-pages and do not specify
PARAM CACHE cache-pages, the extensible-pages value specifies the size
of extensible cache. If you specify both parameters, the extensible-pages
value is used only as a Boolean to indicate whether the cache is extensible.
If the disk volume for SeeView cache does not have enough disk space, SeeView
might abend with an “ABEND No disk space available for extensible segment”
message.
PARAM HISTORY history-pages: This parameter sets how many pages of
command history the SeeView program stores. The default is three pages. This
history pool is shared by all tasks, not assigned to each individual task, and is
taken from the cache pool whose size is set by the preceding parameter.
PARAM MODEMWAIT seconds: This parameter redefines the time in seconds
that SeeView waits for a modem to reconnect before SeeView abends with a
modem disconnect error (file-system error 140). Specifying seconds equal to 0
indicates that SeeView waits indefinitely. The default is 240 seconds.
PARAM PEP max-libprocs: This parameter redefines the maximum number
of procedures that you can declare in the procedure library. The default is 512.
PARAM SERVERMODE mode: This parameter runs the SeeView program with
no block-mode input-output file when the value of mode is nonzero. (The default is
zero.) These values define mode functions:
0 Open outfile as block-mode terminal.
1 Do not ever open outfile, run silently.
2 Open outfile only if an error occurs.
3 Open outfile, show all Msg cache messages.
ASSIGN CACHEFILE disc-volume: This parameter redefines the disk swap
volume for cache memory allocation.
Startup Modes
When you start the SeeView program, it selects its command input file from one of
several different sources depending on the operating mode chosen.
Interactive Mode
If neither the IN specification nor the ON statement is included in the startup command,
and the SeeShell file is not present in the current default subvolume or SeeView
program object subvolume, the SeeView program places a free window on terminal
page one and displays an advisory message. You are then free to proceed as desired.
The startup command under these conditions is:
1> SEEVIEW /NAME/
F1
Displays the previous terminal user page. Terminal user pages are numbered from 1 to
lastpage, where the last page is 7, 8, or 13, depending on terminal type. Function
keys F1 (previous), F2 (next), SF1 (first), and SF2 (last) control which terminal page is
displayed. When you are on page one, F1 displays the last user page.
In addition to terminal user pages, an extra terminal page is called the Help page. This
page provides a convenient extra page for obtaining process status information or
command help without disturbing user pages.
SF1
Displays the first terminal page. This function key always displays terminal page one.
F2
Displays the next higher numbered terminal page. If you are already on the last page,
it displays the first page. Terminal pages are numbered from 1 to lastpage, where
the last page is 7, 8, or 13, depending on terminal type.
SF2
Displays the last terminal page or the highest numbered terminal page that has one or
more windows on it.
F3
Scrolls back one command, or scrolls down window text. The operation performed by
this function key depends on the cursor location. When the cursor is on the sill,
function keys F3, F4, SF3, and SF4 depend on the ALTER SILLSCROLL ON | OFF
setting. If the cursor is on the sill of a window and SILLSCROLL is ON (the default), F3
displays the command history for this window. Each time you press F3, a previous
command in the command history appears.
If the cursor is within the window or SILLSCROLL is OFF, F3 scrolls the text within the
window down 1/3 the height of the window.
F4
Scrolls forward one command, or scrolls up window text. The operation of this function
key depends on the cursor location.
If the cursor is on the sill of a window, F4 displays the command history for this
window. Each time you press F4, the next command in the command history appears.
If the cursor is within the window, F4 rolls the text within the window up 1/3 the height
of the window. For a description of the effect of the SILLSCROLL setting on the action
of this function key, see F3.
SF4
Displays the most recent command for window, or scrolls up window text.
If the cursor is on the sill of a window, SF4 displays the command history for this
window. When you press SF4, the newest command in the command history appears.
If the cursor is within the window, SF4 scrolls the text within the window up one line.
For a description of the effect of the SILLSCROLL setting on the action of this function
key, see F3.
F5
Inserts line, or enables the editor.
If the cursor is on the sill of a window, F5 enables the window editor by putting the
window into edit mode.
If the cursor is within a window and you enable the window editor, F5 inserts a line at
the cursor position.
SF5
Toggles free-cursor mode on and off, or inserts text blocks to end of page.
If the cursor is within the text portion of a window and you enable the window editor,
SF5 inserts blank text lines from the current cursor position to the end of the current
text page.
F6
Deletes current line or enables the editor.
If the cursor is on the sill of a window, F6 enables the window editor.
If the cursor is within a window and you enable the window editor, F6 deletes the line
at the cursor position.
Deleted lines are stored in a common copy/retrieve text stack. This provides a way to
copy, delete, and retrieve text between and within windows.
SF6
Deletes window, or deletes text block to end of page.
If the window designated by the cursor is not in edit mode, the window is physically
deleted. Although the window is deleted, the status of the process that was executing
in the window is not affected, and you can build another window on that process.
If the cursor is within the text portion of a window and you enable the window editor,
SF6 deletes text lines from the current cursor position to the end of the current text
page.
Deleted lines are stored in a common copy/retrieve text stack. This provides a way to
copy, delete, and retrieve text between and within windows.
F7
Retrieves line from copy/retrieve text stack.
If the cursor is on the sill of a window, F7 retrieves the line of text that is on top of the
copy/retrieve text stack.
If the cursor is within a window and you enable the window editor, F7 retrieves the line
of text that is on top of the copy/retrieve text stack.
Deleted or copied lines are retrieved from a common copy/retrieve text stack. This
provides a way to copy, delete, and retrieve text between and within windows.
F8
Copies current line.
If the cursor is on the sill of a window, F8 copies the line of text on the sill into the
copy/retrieve text stack.
If the cursor is within a window and the window is in edit mode, the line of text
designated by the cursor is copied into the copy/retrieve stack.
Copied lines are stored in a common copy/retrieve text stack. This makes it possible to
copy and retrieve text between and within windows.
SF8
Copies window, or copies text block to end of page.
If the window designated by the cursor is not in edit mode, the taskid of the window
is copied. You can then retrieve a window on that taskid elsewhere by using the
retrieve window function key, SF7.
If the cursor is within the text portion of a window and you enable the window editor,
SF8 copies text lines from the current cursor position to the end of the current text
page.
Copied lines are stored in a common copy/retrieve text stack. This makes it possible to
copy, delete, and retrieve text between and within windows.
F9
Breaks window or text line.
If the window designated by the cursor is not in edit mode, the window is broken into
two separate windows. The point at which the window is broken is determined by the
SF9
Defines window. This function key interactively defines the physical dimensions of a
window. If the cursor is pointing to a screen area that does not contain a window, you
can define the opposite corners of a window. Once you define the second corner, a
window is built.
When you define a window in this manner, you often use the enable free-cursor mode
key, SF5.
F10
Joins window or text line.
If the window designated by the cursor is not in edit mode, the window is joined with a
neighboring window. The neighbor to which the current window is joined is determined
by the cursor location. The edge nearest the cursor position is the one joined to a
neighboring window that is either above or to the right of the current window. The
break window function key, F9, breaks up a window.
If the window is in edit mode, the line of text designated by the cursor is joined with the
next text line. The width of the joined line thus formed is determined by the width of the
window or the ALTER JOINWIDTH statement, and the column offset is set with the
scroll left or right function keys, SF12 or SF13. You can use HELP ALTER
JOINWIDTH to override the window width.
SF10
Beeps. This function key is reserved for future use.
F11
Returns display to the Help page. User pages 1 through lastpage are reserved for
user-defined windows. In addition to these pages, one extra page is set aside for user
help, process status information, and interactive development of SeeView programs.
This extra page is not accessed with the F1 or F2 keys. F11 displays this extra page,
allowing for extra operations without disturbing the user environment.
Pressing F11 twice in succession builds a SeeView window for script development.
(For a detailed discussion of this function, see Section 7: SeeView Interpreter
Interface.)
F12
Enables FIND / target-text / on sill, or FIND LINE num | ? on sill. This function
searches the current window cache for the text defined on the sill of the current
window. If there is no text on the sill, the cursor is moved to the sill so you can define
the target text. Subsequent invocations of F12 perform a search for the target.
The target text is bounded by a pair of the following delimiters: quote, (“), slash (/),
backslash (\), or single quote („). You can search the cache either forward or backward
by placing a plus sign (+) or minus sign (-) in front of the delimited target text.
If the window is in edit mode, the search begins at the current cursor position within the
window. To display subsequent matches, press F12 repeatedly.
If the window is not in edit mode, forward searches start at the beginning of the text in
the current window and backward searches start at the end of the text in this window. If
the target is found, the line containing this text appears as the first line of the text in the
current window. After the first occurrence appears, you can continue to search for the
target by pressing F12.
If the sill contains L? or LINE?, the logical line number designated by the cursor
appears on line 25. This provides a means of identifying a line number.
If the sill contains L num or LINE num, the specified logical line number appears in the
current window. This provides a means of displaying the text at a specific line number.
SF12
Rolls right by cursor amount. The text in the current window is scrolled to the right by
the number of characters indicated by the current cursor position.
If the cursor is in column 1 of the current window, the text in that window is scrolled to
the right by one character unless the window is rolled all the way to the right. Likewise,
if the cursor is in column 20 of the current window, the text is scrolled to the right by
twenty characters.
F13
Shows user task status in largest free window on the Help page. User pages 1 through
lastpage are reserved for user-defined windows. In addition to these pages, one extra
SF13
Rolls left by cursor amount. The text in the current window is scrolled to the left by the
number of characters indicated by the current cursor position.
If the cursor is in column 1 of the current window, the text in that window is scrolled to
the left by one character unless the window is rolled all the way to the left. Likewise, if
the cursor is in column 20 of the current window, the text is scrolled to the left by 20
characters.
This function, in effect, is one in which the cursor defines the new left edge of the
current text when you press the function key.
F14
Displays HELP ALL information on the Help page. User pages one through lastpage
are reserved for user-defined windows.
In addition to these pages, one extra page is set aside for user help, process status
information, and interactive development of SeeView programs. This extra page is not
accessed with the F1 or F2 keys. F14 displays this extra page with a summary table of
all SeeView keywords and function keys appearing in the largest free window on the
page.
SF14
Recovers all windows and menus. This function recovers all window frames, headings,
and text by rebuilding all currently defined windows from scratch.
This function is provided to recover from irrecoverable input-output errors, such as a
device power off or on or input-output parity errors. It is also useful when you
inadvertently erase text from a window that is in edit mode.
F15
Tabs cursor backward (word/column).
If ALTER option WORDTAB is ON (the default) and the cursor is in a window, the tab
is a word tab. Otherwise it is a column tab.
When the cursor is on the sill, F15 and F16 (tab cursor forward) perform a column tab.
F16
Tabs cursor forward (word/column).
If ALTER option WORDTAB is ON and the cursor is in a window, the tab is a word tab.
Otherwise it is a column tab.
When the cursor is on the sill, F15 and F16 perform a column tab.
SF16
Exits and shuts down environment. This function key completely shuts down the
SeeView environment.
All programs initiated by the SeeView program are stopped and all context maintained
by the SeeView program is destroyed.
A variety of sanity checks are performed to determine whether a shutdown is
acceptable, and an advisory message is issued requesting that you press SF16 again.
PrevPage
Displays previous page of window text.
Shift-PrevPage
Displays first page of window text.
NextPage
Displays next page of window text.
Shift-NextPage
Displays last page of window text.
Shift-RollDown
Rolls down window text 1/3 of window height.
RollUp
Rolls up window text one line.
Shift-RollUp
Rolls up window text 1/3 of window height.
InsertLine
Enables or disables editor.
DeleteLine
Specifies EOFSEEK ON/OFF.
When the EOFSEEK option is ON, the current window automatically displays
subsequent text pages every refresh interval until the end-of-file of the cache appears.
If the current window is defined as an EOFONLY window, this option toggles
EOFONLY ON/OFF. (For a description of refresh intervals, see the REFRESH option
of ALTER 160.
vstc01
If you mark files with any of the preceding letters and then press return, the operation
corresponding to that letter is performed against the file marked with the letter. In the
following example, S was used to resecure marked files.
?MENU MyMenu
{-----------}
[#subvol ] <==? CALL FileInfo ( #MENUINPUT );
[ ] <==?
{-------------------------------------------------------------------}
{ Command marks, rules, and prompt text. }
{-------------------------------------------------------------------}
{
{ Columns Definition
{ ------- ----------
{ [1] Command marks (see SEARCH statement in FileMaint proc)
{ [5] Window no/wait "." don't wait for window to fill else wait
{ [6:59] Command template "^" file, "#" prompt
{ [60:132] Command paramter prompt if # occurs in template
{
{...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+
?PROC ask{#prompt,row,col}
{------------------------}
{ This proc implements a modal WAITED dialogue box.
{ The proc forces a response to #prompt and returns
{ the result in the global string variable #parm.
{
{ Notice that a WAITED accept is performed and that the accept
{ "insists" that the FKEY be pressed while the cursor is positioned
{ within ASK prompt.
{
{ Note that the user can escape this "mode" by pressing F16.
{-----------------------------------------------------------}
PARM #prompt { msg to display with prompt
, row := 1 { row of prompt
, col := #menucol + #menuwidth { column of prompt
, accepted { flag if accept ok
MSG (r) #take #op & " " & #filename; { display op being performed
BESIDE;
IF wait THEN WINDOW fup,#op NOFRAME NOCURSOR {wait for window to fill
ELSE WINDOW fup,#op NOFRAME NOCURSOR CACHE LASTPAGE EOFONLY;
?SECT SubvolPrompt
{-----------------}
{ This section is executed when the script is first invoked, it:
{
{ 1) Declares global variables #SUBVOL and #PARM.
{ 2) Pops up a prompt asking user to "Enter Subvol."
{--------------------------------------------------}