This function calculates the length of an array of type DATASTRUCTURE. The length of an array is the actual number of elements in the array.
length_struct_array ( input_array )
The result of this function is of type NUMBER; the number of elements in the input_array.
The function has one parameter:
Example
DATASTRUCTURE EL
BEGIN
TEXT Field
END
DATASTRUCTURE DS
BEGIN
ARRAY EL Test_array [0]
END
DECLARE struct DEFINED_AS DS
ASSIGN struct.Test_array [1].Field := "TRUE"
ASSIGN struct.Test_array [2].Field := "FALSE"
ASSIGN struct.Test_array [3].Field := "TRUE"
ASSIGN struct.Test_array [4].Field := "TRUE"
ASSIGN struct.Test_array [5].Field := "FALSE"
NUMBER function_result
ASSIGN function_result := length_struct_array (struct.Test_array)
#
@(function_result)
#
Referencing an array element of an array that has been filled beyond its initial length will result in the creation of that element. The element will be created empty.