FOR |
Top Previous Next |
FOR statements are used for iteration of code in VPL programs. The code between the FOR and END_FOR will be executed a number of times.
FOR <variable>:=<n> TO <m> BY <k> DO
The <variable> above is assigned the value n, and the statement is then executed. <variable> will the be incremented by the value <k>, and if <variable> is lesser than <m>, the statement is executed again, and so on. If the BY <k> is omitted, the <variable> is incremented by 1 each time.
Example: INCLUDE rtcu.inc |