RosettaCodeData/Task/Associative-array-Iteration/Lingo/associative-array-iteration.lingo

12 lines
271 B
Text
Raw Permalink Normal View History

2016-12-05 23:44:36 +01:00
hash = [#key1:"value1", #key2:"value2", #key3:"value3"]
-- iterate over key-value pairs
repeat with i = 1 to hash.count
put hash.getPropAt(i) & "=" & hash[i]
end repeat
-- iterating over values only can be written shorter
repeat with val in hash
put val
end repeat