Associative array/Iteration: Difference between revisions

Content deleted Content added
Kotlin: with block idiom
Lingo added
Line 1,518: Line 1,518:
Key 4: my fave Data: 220 120 120
Key 4: my fave Data: 220 120 120
Key 5: black Data: 0 0 0
Key 5: black Data: 0 0 0

=={{header|Lingo}}==
<lang lingo>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</lang>


=={{header|LiveCode}}==
=={{header|LiveCode}}==