Task

The goal is to create an associative array (also known as a dictionary, map, or hash).



Related tasks:

 Associative arrays/Iteration
 Hash from two arrays


See also

 Array
 Associative array: Creation, Iteration
 Collections
 Compound data type
 Doubly-linked list: Definition, Element definition, Element insertion, List Traversal, Element Removal
 Linked list
 Queue: Definition, Usage
 Set
 Singly-linked list: Element definition, Element insertion, List Traversal, Element Removal
 Stack


command assocArray
    local tArray
    put "value 1" into tArray["key 1"]
    put 123 into tArray["key numbers"]
    put "a,b,c" into tArray["abc"]
 
    put "number of elements:" && the number of elements of tArray & return & \
          "length of item 3:" && the length of tArray["abc"] & return & \
          "keys:" && the keys of tArray
end assocArray