length_fieldset_array
The length_fieldset_array function calculates the length of an array of type FIELDSET. The length of an array is the actual number of elements in the array.
length_fieldset_array ( input_array )
The result of this function is of type NUMBER and is the number of elements in the input_array.
The function has one parameter:
- input_array, type FIELDSET. This is the array with length to be determined.
An example is provided here.
DATASTRUCTURE DS
BEGIN
ARRAY FIELDSET 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_fieldset_array (struct.Test_array)
#
@(function_result)
#
If you refer to an array element of an array that is beyond its initial length, it results in the creation of that element. The created element is empty.