User guide

42
VTB USER GUIDE
Example
Used variables:
var1 int
var2 int
var3 int
Select var1
case 10 if var1=10
...
case var2+var3 if var1=var2+var3
...
case 5 TO 20 if var1 is between 5 and 20
...
case 1,6,8 if var1=1 or var1=6 or var1=8
...
case else all other value of var1
...
Endselect
9.8 FOR-NEXT-STEP-EXITFOR
Allow the iteration of a block of instructions for a number of times according to a variable. It is a mix between BASIC
and C languages.
Syntax
For counter = init To condition [Step increment]
[intructions]
ExitFor
Next [counter]
The syntax of the instruction For...Next is composed by the following elements:
counter Mandatory. Numeric variable used as counter of iteration. It can be a BIT variable.
init Mandatory. Initial value of the counter.
condition Mandatory. Iteration will continue until condition is true.
increment Optional. Value added to the counter at the end of each iteration. If it isn't specified it will
assume the value 1. It can be any numeric expression and can assume any value positive as
well as negative.
instructions Optional. Block of instructions to execute during the iteration.
ExitFor It is used to force the stop of the iterations, the program will continue from the line
immediately after the instruction Next.
Notes
It is possible to nest more cycles For...Next Assigning to each cycle a different counter:
Examples
For I = 1 To I<10
For J = 1 To J<10
For K = 1 To K<10
...
Next K
Next J
Next I