Jump to content

Loops/Break: Difference between revisions

Added uBasic/4tH version
m (→‎{{header|Wren}}: Changed to Wren S/H)
imported>Thebeez
(Added uBasic/4tH version)
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
n = 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:
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.