Loops/Foreach: Difference between revisions

Content deleted Content added
Miks1965 (talk | contribs)
PascalABC.NET
Aartaka (talk | contribs)
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}}