length_text_array

The length_text_array function calculates the length of an array of type TEXT. The length of an array is either the array length in the initial declaration of the array or, if the array has more elements than specified in the initial declaration, the length is the actual number of elements in the array.

length_text_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 TEXT. This is the array with length to be determined.

An example is provided here.

ARRAY TEXT test_array [1] 
ASSIGN test_array [1] := "This is the first value"
ASSIGN test_array [2] := "This is the second value"
ASSIGN test_array [3] := "This is the third value"
ASSIGN test_array [4] := "This is the fourth value"
ASSIGN test_array [5] := "This is the fifth value"
NUMBER function_result 

ASSIGN length_function_result := length_text_array (test_array) 

#
@(function_result)
#

If you refer to an array element of an array that is filled beyond its initial length, it results in the creation of that element. The element is created with a default value: 0 for NUMBER, "" for TEXT, and FALSE for BOOL. For example, the test IF testing[1] THEN FI will result in the creation of element 1 in array testing.