How to add your knowledge

getMapValue()

    Table of contents
    1. 1. Synopsis
    2. 2. Syntax
    3. 3. Example 1

    Synopsis

    Gets the value stored in the given map, under the given key. Map and key names are Names. If there is no such map, or no such key in a defined map, it returns NoValue.

    A "map" data structure is sometimes referred to as a "hash table" or "lookup table" and is created with defineMap().

    Syntax

    getMapValue ( map As Name, _
                  key As Name ) As Any 
    Argument Type Description
    map Name The name of the map. Must have been defined using defineMap().
    key Name The name of the value to look up. Must have been set using SetMapValue().

    Example 1

    This example defines a map, sets a couple values, defines the map again without resetting it, gets map keys and some values, and finally deletes a map value.

    Intent >defineMap(:myMap)
    --> True
    Intent >setMapValue(:myMap, :myStringValue, "A String")
    --> True
    Intent >setMapValue(:myMap, :myIntegerValue, 123)
    --> True
    Intent >defineMap(:myMap, reset? := False)
    --> True
    Intent >getMapKeys(:myMap)
    --> {:myStringValue, :myIntegerValue}
    Intent >getMapValue(:myMap, :myStringValue)
    --> "A String"
    Intent >getMapValue(:noMap, :noValue)
    --> NoValue
    Intent >deleteMapValue(:myMap, :myIntegerValue)
    --> True
    Intent >getMapValue(:myMap, :myIntegerValue)
    --> NoValue