Associative array/Iteration: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: changed/added comments and whitespace, changed indentations, corrected a misspelling and a typo.) |
(→{{header|Potion}}: Added potion solution) |
||
Line 2,066: | Line 2,066: | ||
<</a 1 /b 2 /c 3>> {pop =} forall |
<</a 1 /b 2 /c 3>> {pop =} forall |
||
</lang> |
</lang> |
||
=={{header|Potion}}== |
|||
We can traverse tables by key or by key and val. We cannot traverse tables only by val. |
|||
<lang potion>mydictionary = (red=0xff0000, green=0x00ff00, blue=0x0000ff) |
|||
mydictionary each (key, val): (key, ":", val, "\n") join print. |
|||
mydictionary each (key): (key, "\n") print.</lang> |
|||
=={{header|PowerShell}}== |
=={{header|PowerShell}}== |