Associative array/Iteration: Difference between revisions
Content added Content deleted
mNo edit summary |
|||
Line 726: | Line 726: | ||
=={{header|Elena}}== |
=={{header|Elena}}== |
||
<lang elena># |
<lang elena>#import system'collections. |
||
# |
#import system'routines. |
||
⚫ | |||
#define system'routines. |
|||
⚫ | |||
⚫ | |||
// --- Program --- |
|||
⚫ | |||
[ |
[ |
||
// 1. Create |
// 1. Create |
||
var aMap := Dictionary new. |
|||
aMap@"key" := "foox". |
aMap@"key" := "foox". |
||
aMap@"key" := "foo". |
|||
aMap@"key2":= "foo2". |
aMap@"key2":= "foo2". |
||
aMap@"key3":= "foo3". |
aMap@"key3":= "foo3". |
||
aMap@"key4":= "foo4". |
aMap@"key4":= "foo4". |
||
// Enumerate |
// 2. Enumerate |
||
aMap run &each: aKeyValue |
aMap run &each: aKeyValue |
||
[ console writeLine:(aKeyValue key):" : ":aKeyValue ]. |
[ console writeLine:(aKeyValue key):" : ":aKeyValue ]. |