User guide
41
VTB USER GUIDE
9.5 INC
Increments a variable of any type.
Syntax
Inc varname
The argument varname can be any variable declared in the program.
Description
Inc is the same as VAR=VAR+1 but it is executed more quickly.
Example
INC var1 ‘var1 is incremented by 1
9.6 DEC
Decrements a variable of any type.
Syntax
Dec varname
The argument varname può essere una qualsiasi variabile dichiarata nel programma.
Description
Dec is the same as VAR=VAR-1 but it is executed more quickly.
Example
DEC var1 ‘ var1 is incremented by 1
9.7 SELECT-CASE-ENDSELECT
Allow to execute blocks of instructions according the result of an expression.
Syntax
Select expression
[Case condition_1
[instruction_1]] ...
[Case condition_2
[instruction_n]] …
…
[Case Else
[instructionelse]]
EndSelect
The syntax of the instruction Select Case is composed by the following elements:
expression Mandatory. Any expression.
condition_n Mandatory. It can be in two forms: expression, expression To expression.
The keyword To specifies a range of value.
instruction_n Optional. Instructions executed if the expression matches the condition_n.
instructionelse Optional. Instructions executed if no condition_n is matched.
Notes
If the result of expression equals a condition_n, the following instructions will be executed until the next instruction
Case or Case Else or EndSelect.
If more than one condition_n is matched, only the first encountered will be execute. Case Else is used to execute a
block of instruction if no condition are verified. Although it isn't mandatory, it is recommended the use of Case Else
statement in each Select to manage also unexpected value of expression.
More instruction Select Case can be nested. At each instruction Select Case there must be an associated EndSelect.