Map Get / Replace Value Border Node

Requires: Base Development System

Use this border node to access and modify a value in a map without copying the value out of the map. Use the border node on the left side of the structure to retrieve a value in a map. Use the border node on the right side of the structure to modify or discard the retrieved value.

To place this border node on the In Place Element structure, right-click the border of an In Place Element structure and select the Add Map Get / Replace Value option from the shortcut menu. Alternatively, you can use the In Place Map Access VI, which places an In Place Element structure on the block diagram with this border node added.

Examples

map specifies the map in which you want to look for a key. This input accepts a map of any data type. The default data type is a map of 32-bit signed integers.
key specifies the key to look for in the map. The key must be of the same data type as the existing keys in the map.
default value specifies the value to return in value if the specified key does not exist in the map. This input must be of the same data type as the existing values in the map.
key not found? returns TRUE if map does not include an entry with the specified key. Otherwise, key not found? returns FALSE .

This output exists on both the left and right border nodes. The two key not found? outputs return the same value.
value returns the value of the entry with the associated key if key not found? is FALSE. If key not found? is TRUE, this output returns the value in default value.
action specifies the operation to perform on the map based on the TRUE or FALSE value of key not found?. This input assumes the value 0 if unwired.

0Modify Entry only if found (default)—If key not found? is FALSE, this node replaces the existing associated value with the new value. If key not found? is TRUE, this node does nothing.
1Add or Modify Entry—If key not found? is FALSE, this node replaces the existing associated value with the new value. If key not found? is TRUE, this node adds the new key and the associated value to the map.
2Delete Entry—If key not found? is FALSE, this node deletes the entry with the specified key from the map. If key not found? is TRUE, this node does nothing.
value specifies the new value of the entry with the associated key.
map returns the resulting map.
key returns the same value as the key input on the left side of the border node.

Examples

Refer to the following VIs for examples of using the Map Get / Replace Value border node: