length_struct_array

The length_struct_array 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 and is the number of elements in input_array.

The function has one parameter:

  • input_array, type DATASTRUCTURE. This is array with length to be determined.

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)
#

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.