get_keys_text_map

The get_keys_text_map function retrieves the index values of all elements in a MAP and stores them in an array. The index values are stored in the array in random order.

 get_keys_text_map ( input_map;result_array)

This function returns a NUMBER, which is the number of elements stored in the array.

This function has two parameters:

  1. input_map is a MAP of type TEXT. The MAP whose index values you need.
  2. result_array is an array of type TEXT. The array with index values to be stored.

An example is provided here.

MAP TEXT input_map 

ASSIGN input_map ["first"] := "This is the first value"
ASSIGN input_map ["second"] := "This is the second value"
ASSIGN input_map ["third"] := "This is the third value"
ASSIGN input_map ["fourth"] := "This is the fourth value"
ASSIGN input_map ["fifth"] := "This is the fifth value"

ARRAY TEXT result_array[1]  
NUMBER number_of_elements  

ASSIGN number_of_elements := get_keys_text_map (input_map;result_array) 

NUMBER counter  
FOR counter
	FROM 1  
	UPTO number_of_elements  
DO
#
The key @(result_array[counter]) contains @(input_map[result_array[counter]]) in the map. 
#
OD