MapValuesGet

Returns all the values of a WIL map's key-value pairs

Syntax:

MapValuesGet(map, return-type [, delimiter])

Parameters:

(m) map: a variable containing a WIL map.

(n) return-type: type of collection returned: 1 for an array and 2 for a delimited list.

(s) delimiter: [optional] single character delimiter. Only used when an delimited list is returned. (defaults to a tab character (@Tab)).

Returns:

(a/s)  an array or list of map values.

 

The MapKeysGet function returns either an array or a delimited list of  all of the values of the key-value pairs stored in a WIL map .

The second parameter controls the type of values collection the function returns.  Place a one (1) in the parameter to obtain a one-dimension array with each element holding one of the values stored in the WIL map or place a two (2) in the parameter to obtain a delimited list of values stored in the WIL map.

Note: Since delimited lists are text based, map values are converted to a text representation when return-type 2 is indicated. Any map values that do not have a text representation are not included in the returned delimited list.

Use the third parameter to optionally change the delimiter used to separate values when you request that the function return a delimited list. The delimiter parameter can only contain a single character.

Note: The delimiter parameter is optional and has no effect when an array return is requested. When an delimited list return type is requested and the delimiter parameter is not supplied, the function defaults to a tab character (@Tab) delimiter.

Example:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Get an item list of WIL map values
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Add 2 countries and their calling codes
Pairs = 'Norway,+47':@tab:'Italy,+39'
PhPrefix = MapCreate(Pairs)
PreFixes = MapValuesGet(PhPrefix , 2, @lf)
Message("Country Map Phone Number Prefixes", PreFixes)
See Also:

MapCreate, MapKeyExist, MapKeyRemove, MapFileGetCsv, MapFilePutCsv, MapKeysGet, MapKeyFind