DO CommandThe DO and ENDDO commands allow a set of commands to be repeated a fixed number of times. The section of a Script to be repeated is terminated by an ENDDO command. Command Definition:DO index = value1, value2 {, step} command{s} ENDDO indexThe name of the index variable that is adjusted each time the loop executes. The adjustment is determined by the value of the step variable. This must be an integer variable. value1The starting value of the index variable. This must be either an integer variable or an integer value. value2The terminating value of the index variable. This must be an integer variable or value, and may be either higher or lower than value1. When the control variable contains a value that is greater than this value (or lower if the step is negative), the loop will be terminated. stepAn integer variable or value determining the value by which the index variable is altered each time the loop executes. If value2 is less than value1, then the step value must be negative. If a step variable is not specified, then the step value will default to 1. Examples:DO Empno = 1, 1000 NEXT Name LOG 'Employee number: ', Empno, '; Name: ', Name ENDDO DO Empno = Start, End, 10 NEXT Name LOG 'Employee number: ', Empno, '; Name: ', Name ENDDO |
|
<<< prev page |
^^^ section start |
>>> next page |
Proud to be Open, prouder to be Free |
OpenSTA SCL Reference, version 2.0.6 Copyright & License Info on ToC page |
Last Updated: 2005-05-11 |