Loops/Break: Difference between revisions

m (→‎{{header|Wren}}: Changed to Wren S/H)
 
(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.
.</syntaxhighlight lang="qbasic">Do
an = random Rnd(20)
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 lang="text">repeat
repeat
a = random 20
a = randint 20
print a
until print a = 10
until a = 10
print random 20
print arandint 20
.</syntaxhighlight>
.
</syntaxhighlight>
 
=={{header|Eiffel}}==
Line 2,280 ⟶ 2,290:
write .i, " "
if .i == 10 { writeln(); break }
write random(0..19), " "
}</syntaxhighlight>
 
885

edits