Loops/Foreach: Difference between revisions

Add ed example
(PascalABC.NET)
(Add ed example)
 
(One intermediate revision by one other user not shown)
Line 1,238:
5
</pre>
 
=={{header|Ed}}==
 
Print all (newline-separated) lines in the file.
 
}</syntaxhighlight lang="sed">
,p
</syntaxhighlight>
 
=={{header|Efene}}==
Line 1,843 ⟶ 1,851:
=={{header|langur}}==
A for in loop iterates over values and a for of loop iterates over keys.
<syntaxhighlight lang="langur">for .i in [1, 2, 3] {
for i in [1, 2, 3] {
writeln .i
}
 
val .abc = "abc"
 
for .i in .abc {
writeln .i
}
 
for .i of .abc {
writeln .abc[.i]
}
 
for .i in .abc {
writeln cp2s .(i)
}
}</syntaxhighlight>
</syntaxhighlight>
 
{{out}}
104

edits