Associative array/Iteration: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 925: | Line 925: | ||
=={{header|EasyLang}}== |
=={{header|EasyLang}}== |
||
<syntaxhighlight |
<syntaxhighlight> |
||
# 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 |
for i to len clothing$[][] |
||
print |
print clothing$[i][1] & ": " & clothing$[i][2] |
||
⚫ | |||
. |
|||
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] |
|||
. |
|||
⚫ | |||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
Key-value pairs: |
|||
1 associative |
|||
2 arrays |
|||
Just keys: |
|||
1 |
|||
2 |
|||
Just values: |
|||
associative |
|||
arrays |
|||
</pre> |
|||
=={{header|EchoLisp}}== |
=={{header|EchoLisp}}== |