PML Customisation User Guide

Arrays
An ARRAY variable can contain many values, each of which is called an array element. An Array is created automatically by creating one of its array elements.
This will create an array variable named !NewArray if it does not already exist and will set element 1 of that array to the value of !NewValue. If !NewArray already exists as a simple variable, you will get an error message and the command will be ignored.
Note:
How array elements are referred to by means of a subscript expression in [ ] square brackets and that there must be no space between the end of the array name and the subscript. Array elements are accessed in the same way when using the value in an expression:
The individual elements of an array variable can be set independently and in any order. Thus you can set !X[1] and !X[10] without setting any of the intervening elements !X[2] to !X[9]. In other words PML arrays are allowed to be ‘sparse’ and to have gaps between the subscript numbers which have values set.
An array subscript of zero is allowed but you are advised against using it as many of the array facilities ignore array element zero.
Non-existent array elements — after the last set element of the array and the non-existent elements in the gaps of a sparse array — are all UNDEFINED: the function Undefined() will return TRUE and the function Defined() will return FALSE for all these subscripts.

1974 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
AVEVA Logo