Loops/Foreach: Difference between revisions
Content added Content deleted
(Added C3 code.) |
(Add LDPL) |
||
Line 1,773: | Line 1,773: | ||
<syntaxhighlight lang="lasso">array(1,2,3) => foreach { stdoutnl(#1) }</syntaxhighlight> |
<syntaxhighlight lang="lasso">array(1,2,3) => foreach { stdoutnl(#1) }</syntaxhighlight> |
||
<syntaxhighlight lang="lasso">with i in array(1,2,3) do { stdoutnl(#i) }</syntaxhighlight> |
<syntaxhighlight lang="lasso">with i in array(1,2,3) do { stdoutnl(#i) }</syntaxhighlight> |
||
=={{header|LDPL}}== |
|||
<syntaxhighlight lang="ldpl">data: |
|||
fruits is text list |
|||
fruit is text |
|||
procedure: |
|||
split "apple banana orange" by " " in fruits |
|||
for each fruit in fruits do |
|||
display fruit lf |
|||
repeat |
|||
</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
apple |
|||
banana |
|||
orange |
|||
</pre> |
|||
=={{header|LFE}}== |
=={{header|LFE}}== |