Loops/Foreach: Difference between revisions

Content added Content deleted
(→‎{{header|ALGOL 68}}: Corrected the ALGOL 68 RS FORALL syntax)
Line 287: Line 287:
print((c," "))
print((c," "))
OD</syntaxhighlight>
OD</syntaxhighlight>

=={{header|Amazing Hopper}}==
<syntaxhighlight lang="bennugd">
#include <jambo.h>

Main
things = {}, len list=0
Set ' 100,200,300,"Hello world!", -3,-2,-1 ' Apndlist 'things'
Let ' len list := Length(things) '
Printnl ' "\nNormal count:\n" '
For each( n, things, len list )
Printnl ' "Thing : ", n '
Next

Printnl ' "\n\nReverse count:\n" '
For each reverse ( n, things, len list )
Printnl ' "Thing : ", n '
Next
End
</syntaxhighlight>
{{out}}
<pre>
Normal count:

Thing : 100
Thing : 200
Thing : 300
Thing : Hello world!
Thing : -3
Thing : -2
Thing : -1


Reverse count:

Thing : -1
Thing : -2
Thing : -3
Thing : Hello world!
Thing : 300
Thing : 200
Thing : 100

</pre>


=={{header|AmigaE}}==
=={{header|AmigaE}}==