/sys$common/syshlp/helplib.hlb FORTRAN, Statements, DO *Conan The Librarian (sorry for the slow response - running on an old VAX) |
Executes a block of statements repeatedly until the value of a control variable equals, exceeds, or is less than the terminal value, according to the control variable specified in the DO loop. The block of statements starts immediately following the DO statement. You can transfer control out of a DO loop, but not out of a parallel DO loop. Statement format: DO [s[,]] v = e1,e2[,e3] s Is the optional label of an executable statement that follows the DO statement in the same program unit. The label designates the last statement of the DO loop. If omitted, an END DO statement is required. v Is the control variable; an integer or real variable (it cannot be a record field). You cannot modify the control variable inside the DO loop. e1 Is the initial value of the control variable; an integer or real value. e2 Is the terminal value of the control variable; an integer or real value. e3 Is the value by which to increment the control variable after each execution of the DO loop; integer or real value. It cannot be 0. The default of e3 is 1. If the iteration count (the number of executions of the DO range) is zero or negative, the body of the loop is not executed. If the /NOF77 compiler option is specified and the iteration count is zero or negative, the body of the loop is executed once.
|