Jump to content

Associative array/Iteration: Difference between revisions

Lingo added
(Kotlin: with block idiom)
(Lingo added)
Line 1,518:
Key 4: my fave Data: 220 120 120
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}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.