get_keys_number_map

The get_keys_number_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_number_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 NUMBER. The MAP with the 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 NUMBER input_map 

ASSIGN input_map ["first"] := 12345
ASSIGN input_map ["second"] := 67890
ASSIGN input_map ["third"] := 9876
ASSIGN input_map ["fourth"] := 54321
ASSIGN input_map ["fifth"] := 65748
ARRAY TEXT result_array[1]

NUMBER number_of_elements 

ASSIGN number_of_elements := get_keys_number_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