MAPSET

Sets a key/value pair on a map.

Parameters

OrderNameTypeDesc
1mapmapThe map to be modified
2keyconstThe name of the key to set
3valueconstThe value to set

Returns

Places an map on the stack.

Description

This function modifies map to include a new key-value pair.

If the key already exists, it will be overwritten with the new value.

If the key does not already exist, it will be added to the map.

For example, if you had the following map in your stack…

{ “name”: “alpha”,

     "colour": "orange",
     "style": "plain" }
      

…then the command 'colour' 'blue' MAPSET will change the 'colour' element from orange to blue.

See Also