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

12 lines
203 B
Plaintext

h[1]: 6$
h[9]: 2$
/* iterate over values */
for val in listarray(h) do (
print(val))$
/* iterate over the keys */
for key in rest(arrayinfo(h), 2) do (
val: arrayapply(h, key),
print(key, val))$