SeeView Manual

SeeView Statements and Script Symbols
HP NonStop SeeView Manual526355-004
9-41
FOR
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.
DO statement
specifies a single statement or a compound statement delimited with BEGIN and
END terms. The statement following DO is executed expression times.
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.
VAR #pages := #PAGESUSED; { #pages is list of pages, e.g. "1 2 3 4"
WHILE #pages<>"" DO BEGIN { While there are #pages left.
PAGE #TRIM #pages; { Show each page.
FLUSH; { Cause page switch I/O to occur.
WAIT 1, refresh; { Wait 1 second.
END;
FOR expression DO statement
?PROC DrawWindowsOn(#tasklist, rows, cols)
{----------------------------------------}
{ This proc displays rows*cols windows on task
{ names contained in parameter string #tasklist.
{----------------------------------------------}
PARM #tasklist { tasks to draw windows on
, rows:=3 { default number of rows
, cols:=3 { default number of cols
;
VAR #list := #tasklist
,#tid { task variable name
, w := 80/cols { window width
, h := 24/rows { window height
, row := -1 { current logical row
;