Loop based on an expression.
For <variable> = <start> To <stop> [Step <stepval>]
statements
...
Next
Parameters
variable | The variable used for the count. |
start | The initial numeric value of the variable. |
stop | The final numeric value of the variable. |
stepval | [optional] The numeric value (possibly fractional) that the count is increased by each loop. Default is 1. |
Remarks
The Variable will be created automatically with a LOCAL scope, even when MustDeclareVars is on.
Related
ContinueLoop, ExitLoop
Example
For $i = 5 to 1 Step -1
MsgBox(0, "Count down!", $i)
Next
MsgBox(0,"", "Blast Off!")