Jump to content

Flow-control structures: Difference between revisions

Added 11l
(→‎{{header|Wren}}: Updated to version 0.4.0.)
(Added 11l)
Line 14:
*   [[Iteration|Loop Structures]]
<br><br>
 
=={{header|11l}}==
{{trans|Python}}
===Loops===
11l supports ''L.break'' and ''L.continue'' to exit from a loop early or short circuit the rest of a loop's body and "continue" on to the next loop iteration.
<lang 11l>V n = 10
Int result
 
L(i) 0 .< n
I (n % 2) == 0
L.continue
I (n % i) == 0
result = i
L.break
L.was_no_break
result = -1
print(‘No odd factors found’)</lang>
In addition, as shown in the foregoing example, 11l loops support an ''L.was_no_break'' suite which can be used to handle cases when the loop was intended to search for something, where the code would break out of the loop upon finding its target.
 
=={{header|360 Assembly}}==
1,481

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.