SeeView Manual

SeeView Statements and Script Symbols
HP NonStop SeeView Manual526355-004
9-117
WHILE
WHILE
The WHILE statement performs iteration.
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).
?PROC Monitor ( #nodelist, #logname )
{-----------------------------------}
{ Build log monitor windows on nodes in #nodelist.
{ #Nodelist contains sys names without backslashes.
{-------------------------------------------------}
PARM #nodelist { list of system names
,#logname := "$system.system.oprlog"
;
VAR #list:= #nodelist { temp sys name list
,#sys := #trim #list { current system name
,#z { execute string variable
,#tasklist { list of started tasks
, nodes:=0 { number of nodes in list
;
WHILE #sys<>"" DO BEGIN { Build TASK <sys> for each
{ Build TASK <sys> := seedit ALLOWERROR
#z := "TASK "&#sys&":= seedit ALLOWERROR";
EXECUTE #z;
IF #TASKERROR THEN BEGIN { Can't monitor, show error
MSG(r) "Cannot Monitor \" & #sys &
" (" & #taskerrortype &"," & #taskerror &")";
FLUSH;
END ELSE
BEGIN { Task running, add to list,
nodes := nodes +1; { send it MONITOR command.
#tasklist := #tasklist & " " & #sys;
EXECUTE "with " & #sys;
IF NOT (#TASKSTART OR #TASKPROMPTING) THEN BEGIN
BREAK #TASKID; { Send task a break, and
WRITE #TASKID,""; { wait for break to take,
END; { then write command.
WRITE #TASKID,"MONITOR \" &#sys& "." & #logname;
END;
#sys := #TRIM #list; { get next sys name
END;
IF nodes<=0 THEN RETURN; { nothing to monitor
LINE 1; { line 1 of current page
#list:= #tasklist; { list of live monitors
FOR NODES DO BEGIN { build window on each sys
#sys := #TRIM #list; { in #list of systems
#z := "WITH " & #sys; { get with #sys
EXECUTE #z;
WINDOW #TASKID { build window on #sys
SIZE 80,24/nodes
EOFONLY CACHE LASTPAGE NOFRAME;
DOWN:24/nodes;
END;
WHILE expression DO statement;