IntelliMacro.NET supports a variety of control flow statements like loops and conditions. Even the BASIC-style GoTo command is available!
Labels look like variable names, but end with a semicolon. The GoTo command can be used to jump to a label:
GoTo label
GoTo label If expression
The second form will only jump if the numeric value of the expression is not zero.
It is also possible to jump to a dynamically built label:
GoTo (expression)
GoTo (expression) If expression
Note that the expression must be in parentheses, and it must evaluate
to a string
There are two kinds of For loops, classic for loops and foreach loops:
For variable = start .. end
...
End
For variable : list
...
End
In the first form, variable is assigned all the values between start and end in turn; in the second case, variable is assigned all the members of list. You can use subscript or slice or list assignments as well here.
While loops are simple, they execute a block while an expression is nonzero:
While expression
...
End
If blocks are no loops, they execute one of the blocks depending on some conditions.
If expression
...
ElseIf expression
...
Else
...
End
Exit statements are used to preliminary exit a block or loop.
Exit depth
Depth must be a literal non-negative integer value. 0 quits the program, any other number quits that number of loops. You can omit the value if it is 1
Repeat statements are usually used at the end of a macro; they cause the macro to start over if the <BREAK> key has not been pressed.
Repeat count
Count must be a literal non-negative integer value. A count of 0 repeats indefinitely and may be omitted.