User`s guide

Arrays
V+ supports arrays of up to three dimensions. Any V+ data type can be stored in an array.
Like simple variables, array allocation (and typing) is dynamic. Unless they are declared to be
AUTOmatic, array sizes do not have to be declared.
For example:
array.one[2] = 36
allocates space for a one-dimensional array named array.one and places the value 36 in
element two of the array. (The numbers inside the brackets ([]) are referred to as indices.
An array index can also be a variable or an expression.)
$array.two[4,5] = "row 4, col 5"
allocates space for a two-dimensional array named array.two and places row 4, col 5 in row
four, column five of the array.
array.three[2,2,4] = 10.5
allocates space for a three-dimensional array named array.three and places the value 10.5 in
row two, column two, range four.
If any of the above instructions were executed and the array had already been declared, the
instruction would merely place the value in the appropriate location. If a data type different
from the one the array was originally created with is specified, an error will result.
Arrays are allocated in blocks of 16. Thus, the instruction:
any_array[2] = 50
results in allocation of array elements 0 - 15. The instructions:
any_array[2] = 50
any_array[20] = 75
results in the allocation of array elements 0 - 31.
Array allocation is most efficient when the highest range index exceeds the highest column
index, and the highest column index exceeds the highest row index. (Row is the first
element, column is the second element, and range is the third element.)
Global Array Access Restriction
V+ has a feature where global and LOCAL arrays are automatically extended as they are
used. For efficiency, there is no interlocking of the array extension process between multiple
tasks. A crash to DDT can occur if one task is extending or deleting an array while another is
trying to access it. The AIM software application has built-in protection to prevent this
problem and the resulting crash. However, custom V+ programs must be coded to avoid this
problem using one of the following methods:
Arrays
(Undefined variable: Primary.Product_Name_V)Language User's Guide, version
17.x
Page 105