get_keys_bool_map

The function get_keys_bool_map 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_bool_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 BOOL. The MAP with the index values.
  2. result_array is an array of type TEXT. The array with index values to be stored.

An example is provided here.

MAP BOOL input_map 
ASSIGN input_map ["first"] := TRUE
ASSIGN input_map ["second"] := FALSE
ASSIGN input_map ["third"] := TRUE
ASSIGN input_map ["fourth"] := TRUE
ASSIGN input_map ["fifth"] := FALSE
ARRAY TEXT result_array[1] 

NUMBER number_of_elements 

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