SeeView Manual

SeeView Statements and Script Symbols
HP NonStop SeeView Manual526355-004
9-156
String Intrinsics
You can use this intrinsic to save the contents of a cache to the file from which it
was loaded. For example:
#MENUCACHELINE
returns the ordinal cache record number (from 0 to n) of the first line of text
appearing 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.
One way you can use this intrinsic is to programmatically determine where the first
line of text in the window just referenced is located in cache.
For example, to recreate a menu window on the same cache (possibly after
changing something in cache):
#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.
SAVE #MENUCACHEFILE !, #MENUTASKID;
WINDOW #MENUTASKID MENU CACHE INDEX #MENUCACHELINE;
VAR #s := #MENUTEXT; { text in line pointed to
VAR i := #MENUTOKENINDEX; { char index of token in menutext
VAR L := #SIZE #MENUTOKEN; { length of token to upcase
IF L THEN BEGIN { have a token, upcase it
FOR L DO BEGIN
IF #ALPHA #s[i] THEN #s[i] := #CHAR (#ORD #s[i] AND 223);
i:=i+1;
END;
WRITE #MENUTASKID CACHE #MENUCACHELINEPTR UPDATE,#s;
END;