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["key"]


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.0.0

 


Dictionary["key"]

returns the Dictionary's value for the submitted key string. For example:

$MyDictionary=dictionary("cat:animal; dog:animal; rock: mineral"); 

$MyString = $MyDictionary["dog"]; 

sets MyString to the string "animal".

It is not required to use quotes around key.

The key may also be a (loop) variable, or an attribute value. The latter are evaluated before use:

$MyList.each(anItem){$MyString = $MyString + ", " + $MyDictionary[anItem];} 

$MyString = $MyDictionary[$SomeAttribute];} 

This has the same effect as .at( ), but may be more convenient. Note that in both the square-bracket syntax and .at() syntax a numerical key value is interpreted as a key and not a list item number, unlike List/Set.at().