ValueMapper (open)
A dictionary/map to look up values by key
Syntax
LOADLIB "wh::util/algorithms.whlib";
OBJECTTYPE ValueMapper
Constructor
Properties
- PROPERTY casesensitive
Whether lookups are case sensitive. Default is case insensitive. Explicitly setting to false for non-strings is an error.
Functions
- MACRO Add(VARIANT fromval, VARIANT toval)
Add a key and a value to this mapping
- MACRO AddMultiple(RECORD ARRAY inmap)
Add multiple keys and values to this mapping
- RECORD ARRAY FUNCTION GetAllMappings()
Returns the list of all mappings
- VARIANT FUNCTION Has(VARIANT inval)
Looks up a value by a key, throws if the no value is found for that key
- VARIANT FUNCTION Lookup(VARIANT inval)
Looks up a value by a key, throws if the no value is found for that key