For...Next
Previous  Next

Description: Creates a loop that will repeat a specified number of times.

     Syntax:
     
For <CounterVariable> = <StartValue> To <EndValue> [Step <StepValue>]
    [Statements]
    [Continue For]
    [Exit For]
Next [<CounterVariable>]

Part
Description
<CounterVariable>
Required for the For statement. This variable controls the number of iterations for the loop.
<StartValue>
Required. The initial value of the counter.
<EndValue>
Required. The ending value of the counter.
[Statements]
Optional. This is the code that will be executed each iteration.
[Continue For]
Optional. Returns to the beginning of the loop
[Exit For]
Optional. Exits the For...Next loop
Next
Required. Ends the scope of the For...Next loop

Example:

    For i = 5 TO 1 Step -1
        Print i
    Next