REPEAT
REPEAT … UNTIL expr
Begins the definition of a REPEAT/UNTIL loop.
SmallBASIC starts executing the commands between the REPEAT and UNTIL
commands. When SmallBASIC encounters the UNTIL command, it evaluates the
expression parameter expr
. If that parameter is zero
(false), the process will be repeated; otherwise, execution continues at
the next command. The REPEAT/UNTIL loop evaluates the expression at the
end of the loop. Therefore at least one loop is performed.
REPEAT/UNTIL loops may be nested to any level of complexity, but there must be an UNTIL for each REPEAT.
See WHILE…WEND loop if you want to evaluate the expression at the begin of the loop.
Example
1
C = REPEAT
PRINT C
1
C = C + UNTIL C == 10
' Output: 1 2 3 4 5 6 7 8 9
Code samples using REPEAT
004 loops.bas
3d wire cube v1.bas
3d wire cube.bas
3d_torus.bas
A Rubens, Peter Paul Landscape.bas
agendus.bas
anball 1.0.bas
autumn scene.bas
Ball.bas
balls.bas
betrayal: crows ii.bas
bezier_pen.bas
bezierbounce.bas
blackbox.bas
Blackbox.bas
bolmo.bas
btn 21.bas
bulls and cows.bas
Calendar.bas
calendar.bas
Chaos_1xt.bas
Chaos_NPhase.bas
checkers.bas
checkers.bas
chess.bas
chess.bas
circle trap.bas
circles Kalide v2.bas
coordplot.bas
Language
AND
AS
BAND
BG
BOR
BYREF
CALL
CASE
CATCH
CONST
DECLARE
DEF
DO
ELIF
ELSE
ELSEIF
END
END TRY
ENDIF
EQV
EXIT
FALSE
FI
FOR
FUNC
GOSUB
GOTO
IF
IFF
IMP
IN
LABEL
LET
LIKE
LOCAL
LSHIFT
MDL
MOD
NAND
NEXT
NOR
NOT
ON
OR
REM
REPEAT
RETURN
RSHIFT
SELECT
STEP
STOP
SUB
THEN
THROW
TO
TRUE
TRY
UNTIL
USE
USG
USING
WEND
WHILE
XNOR
XOR
If there is insufficient information on this page and you wish learn more about REPEAT,
please send an email to smallbasic@gmail.com. You can help to improve information about
REPEAT by submitting a pull request,
click View Source for details. Note, an offline language reference text file is also available - see the Download section.