Loops/Foreach: Difference between revisions

Content added Content deleted
m (→‎{{header|Wren}}: Changed to Wren S/H)
imported>Arakov
Line 1,220: Line 1,220:


=={{header|Elena}}==
=={{header|Elena}}==
ELENA 5.0 :
ELENA 6.x :
<syntaxhighlight lang="elena">import system'routines;
<syntaxhighlight lang="elena">import system'routines;
import extensions;
import extensions;
Line 1,228: Line 1,228:
var things := new string[]{"Apple", "Banana", "Coconut"};
var things := new string[]{"Apple", "Banana", "Coconut"};
things.forEach:(thing)
things.forEach::(thing)
{
{
console.printLine:thing
console.printLine(thing)
}
}</syntaxhighlight>

=== Using foreach statement template ===
<syntaxhighlight lang="elena">import extensions;
public program()
{
var things := new string[]{"Apple", "Banana", "Coconut"};
foreach(var thing; in things)
{
console.printLine(thing)
}
}
}</syntaxhighlight>
}</syntaxhighlight>