SeeView Manual
SeeView Statements and Script Symbols
HP NonStop SeeView Manual—526355-004
9-94
SEARCH
follow the scan-string with an index range to be scanned for. Thus SCAN #s[ i :
j ] limits the scan to characters “i” through “j”.
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.
SEARCH
The SEARCH statement searches the specified taskid cache for text. The search is not
case-sensitive.
taskid
specifies the taskid of the cache that is searched for target.
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
SEARCH taskid CACHE [+|-] target -> line [, col ]
[ LINEFOUND string-var ]
[ MENUTEXT ]
[ STARTING line [ , col ]