Loops/Break: Difference between revisions
→{{header|langur}}
m (→{{header|Wren}}: Changed to Wren S/H) |
Langurmonkey (talk | contribs) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 877:
==={{header|uBasic/4tH}}===
In uBasic/4tH '''UNTIL''' ''<cond>'' is equivalent to '''IF''' ''<cond>'' '''THEN BREAK'''. You can add as many '''UNTIL''' and '''WHILE''' as required in '''FOR..NEXT''' or '''DO..LOOP''' loops.
Print n
Until n=10
Print Rnd(20)
Loop</syntaxhighlight>
==={{header|ZX Spectrum Basic}}===
On the ZX Spectrum, for loops must be terminated through the NEXT statement, otherwise a memory leak will occur. To terminate a loop prematurely, set the loop counter to the last iterative value and jump to the NEXT statement:
Line 1,339 ⟶ 1,347:
=={{header|EasyLang}}==
<syntaxhighlight
repeat
▲ a = random 20
a = randint 20
print a▼
until a = 10
▲.</syntaxhighlight>
.
</syntaxhighlight>
=={{header|Eiffel}}==
Line 2,280 ⟶ 2,290:
write .i, " "
if .i == 10 { writeln(); break }
}</syntaxhighlight>
|