This version is out of date, covering development from v9.0.0 to v9.3.0. It is maintained here only for inbound reference links from elsewhere. It is no longer actively updated.

Jump to the current version of aTbRef

Tinderbox v9 Icon

Dictionary.extend(key, value)


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Altered: 

 Function   [other Function type actions]

 Item   [operators of similar scope]

 Dictionary, Set & List operations   [other Dictionary, Set & List operations operators]

 9.1.0

 


Dictionary.extend(key, value)

This adds value to the value(s) of a key.

If key does not exist, that key is created with a value of value.

If key exists, value is appended to key's existing value(s).

Assume $MyDictionary has no 'pear' key. Example:

$MyDictionary = $MyDictionary.add("pear","fruit"); 

The key 'pear' is added and now has value 'fruit'. Next:

$MyDictionary = $MyDictionary.add("pear","green"); 

The key 'pear' now has a new value 'green', but overall value is now the list 'fruit;green'.

To set the new value so it replaces all existing value(s) see Dictionary.add().