Associative array/Iteration: Difference between revisions

m
No edit summary
Line 925:
 
=={{header|EasyLang}}==
<syntaxhighlight lang="easylang">
# use array of array for this
associative$[][] = [ [ 1 "associative" ] [ 2 "arrays" ] ]
clothing$[][] = [ [ "type" "t-shirt" ] [ "color" "red" ] [ "size" "xl" ] ]
print "Key-value pairs:"
for i = 1 to len associativeclothing$[][]
print associativeclothing$[i][1] & ": " & associativeclothing$[i][2]
.</syntaxhighlight>
.
print "Just keys:"
for i = 1 to len associative$[][]
print associative$[i][1]
.
print "Just values:"
for i = 1 to len associative$[][]
print associative$[i][2]
.
</syntaxhighlight>
{{out}}
<pre>
Key-value pairs:
1 associative
2 arrays
Just keys:
1
2
Just values:
associative
arrays
</pre>
 
=={{header|EchoLisp}}==
1,995

edits