User guide
25
VTB USER GUIDE
6.5 Arrays
The arrays can be declared in the INTERNAL or STATIC variables and they can be defined as any type except the BIT one.
The arrays managed by VTB are SINGLE-DIMENSION and the maximum limit depends on the free memory available. To
declare an array we have to do as for a normal variable putting after the name, between parenthesis, the desired
dimension.
If there was the need to use a TWO-DIMENSION array (matrix) we have to work with STRUCTURES. Simply we have to
declare a structure with a field of type array then to declare an array of type structure.
ARRAY(10) Array of 10 elements
The first element of the array always start from 0 (zero) then:
ARRAY(0) first element
ARRAY(9) last element
Some VTB functions need the address of the array, that is specified writing the name of array followed by
parenthesis with no index inside (see also pointer).
ARRAY() refers to the memory address of ARRAY
DECLARING AN ARRAY
WARNING: VTB doesn't make any control on the index of array therefore with it's possible to write over the array's
dimension with consequent risks of unexpected operations.