Array Functions
length
length(ARRAY)
Returns the length of the provided array or array slice (ARRAY-ATTRIBUTE
), or a slice of an array attribute that indicates the zero-based index range of the array elements to compare (ARRAY-ATTRIBUTE[istart..
iend
]
For example, for a "length(myArray)"
returns 4 and "length(myArray[2..3])"
init_array
init_array(size, type)
Creates an array attribute and initializes all array elements to zero. The function receives the following parameters:
- size
The size of the array — i.e., the number of elements in the array.
- Type: Integer
- Requirement: Required
- type
The data type of the array elements.
- Type: String
- Requirement: Required
Valid Values:
'int' — a 64-bit integer'double' — a 64-bit double
For example, an "arr = init_array(3, 'int')"
update expression creates an "arr=init_array(3, 'int'); arr[1]=1; arr[2]=arr[1]+1;"
results in a new
After creating an array attribute, you can use the array operator ([]
) to reference array elements .