Anonymous user
Associative array/Creation: Difference between revisions
→{{header|Logo}}
Walterpachl (talk | contribs) m (→{{header|PL/I}}: add a missing parenthesis) |
|||
Line 1,331:
</lang>
Key 'green' is associated with data item 50 255 50
=={{header|LiveCode}}==
Livecode arrays are only associative, but can be accessed by ordinal if they are used as the key.
<lang LiveCode>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</lang>
Output
<lang LiveCode>number of elements: 3
length of item 3: 5
keys: key numbers
abc
key 1</lang>
=={{header|Logo}}==
|