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

12 lines
271 B
Plaintext

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