GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Download
  • News
  • Community
  • Resources
  • Language Reference
  • SmallBASIC Manual

This view

  • Original page
  • New address

GeezerVison is showing smallbasic.github.io — SmallBASIC | REPEAT

Edit History

REPEAT

REPEAT … UNTIL expr

Home > Reference > Language

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

C = 1
REPEAT
    PRINT C
    C = C + 1
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   chess.bas   circle trap.bas   circles Kalide v2.bas   coordplot.bas   crow.bas   cube3d.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  
This page was last edited on Thu, 6 Jul 2023 11:58:52 +0200 | Markdown processed with pandoc 3.1.12.1
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.