Anonymous user
Loops/Foreach: Difference between revisions
m
→{{header|AWK}}
(Add Racket example) |
m (→{{header|AWK}}) |
||
Line 230:
<lang awk>for(i=1; i <= length(strs); i++) {
print strs[i]
}</lang>
Note that in awk, foreach loops can only be performed against an associative container. It is not possible to loop against an explicit list, so the following will not work:
<lang awk># This will not work
BEGIN {
for (l in "apples","bananas","cherries") {
print "I like " l
}</lang>
|