Return to Statement


Program Loop Example 1

This example demonstrates the use of a DO loop. The program demonstrates the versatility of the start, end and increment values, the starting value, (I-.5), is -.5, the ending value, (J*3), is 1.5 and the increment is .5. This would cause the print statement to be executed five times outputting the value (10*K), which would be -5, 0, 5, 10 and 15 as the value K ranges from -.5 to 1.5.

   I=0
J=.5
DO/L1:,K,(I-.5),(J*3),.5
PRINT/ISTR(10*K)
L1:

This example demonstrates the creation of several points using a nested DO loop.

$$
$$ Declarations
$$
ENTITY/PT(8)
NUMBER/CNTR(2),X(4),Y(4)
DATA/CNTR,-1,1
DATA/X,-.5,0,.5,0
DATA/Y,0,-.5,0,.5
$$
$$ Do Statements
$$
DO/L1:,I,1,2
DO/L1:,J,1,4
$$
$$ Geometry Definition
$$
PT(I*J)=POINT/(CNTR(I)+X(J)),Y(J)
L1:

Nested DO loops using the same label