next

Syntax

next variable

Description

This command will define a program loop that will loop a finite number of times. The for command requires a variable and two values to begin the loop. The variable stores the start value, and is incremented by 1 each loop until it reaches the end value. The next command is placed to mark the end of the loop. As the variable increments during the loop, you can use its value in many ways. You can increase the size of this increment by using the step command. The exit command can be used to exit a for loop.

Example

for i = 1 to 5
    print ( i )
next i