
The for statement is used to execute statements repeatedly, and at the same time specify the values of loop variables. The following are two examples.
for 1->a,a<10,a+1->a
go
endfor
for (1->a,b->0),a<10,(a+1->a,b+5->b)
go
endfor
The first example illustrates the use of a single loop variable, while the second illustrates the use of two loop variables. Both of these "loop variables" are assumed to be input nets of the circuit under test. The format of a "for" construct is given below.
for <init>,<test>,<incr>
<statement list>
endfor
The expressions <init>, <test>, and <incr> are three arbitrary expressions separated by commas. If any of these expressions contain commas, they must be enclosed in parenthesis. The expression <incr> is executed once before the loop begins. The <test> is executed prior to each iteration of the loop and if it is false (equal to zero), the loop terminates. The <incr> is executed prior to every iteration of the loop except the first, but only if the <test> expression is true (non zero). It is possible for the statement list to be executed zero times. For statements may be nested arbitrarily with other for statements, while statements, and if statements.