Element assignment and removal

Updated July 2015

Once declared, elements (i.e. key,value pairs) can be added to the ordered map with standard array assignment syntax, except that the array subscript (the key) is a string rather than a numeric value:

$capitals("california") = "sacramento"   ! for ordmap(varstr;varstr)

$products(“SKU12345”) = PROD’REC         ! for ordmap(varstr;varx)

If the specified key exists already, the operation will replace the value of the existing element. To delete an element, a special value .NULL ("dot null") is assigned:

$capitals("california") = .NULL

Note: Assigning an empty string (“”) to the value of a key does not delete the item!

See Also

•   ORDMAPM for details and example of adding and deleting keys with a multi-map.