intel MCS BASIC-52 — Intel MCS BASIC-52 Versions 1 & 1.1 Operating and Reference Manual PDF (EN)

int e l 4.8 DESCRIPTION OF STATEMENTS STATEMENTS: DO -- UNTIL [rel expr] MODE: RUN TYPE: CONTROL The DO -- UNTIL [rel expr] instruction provides a means of "loop control" within an MCS BASIC-52 program. All statements between the DO and the UNTIL [rel expr] will be executed until the relational expression following the UNTIL statement is TRUE. DO -- UNTIL loops may be nested. EXAMPLES: SIMPLE DO-UNTIL NESTED DO-UNTIL >10 A=0 >10 DO : A=A+1 : DO : B=B+1 >20 DO >20 PRINT A,B,A*B >30 A=A+I >30 UNTIL B=3 >40 PRINT A >40 B=0 >50 UNTIL A=4 >50 UNTIL A=3 >60 PRINT "DONE" >RUN >RUN 1 1 1 1 1 2 2 2 1 3 3 3 2 1 2 4 2 2 4 DONE 2 3 6 3 1 3 READY 3 2 6 > 3 3 9 READY > VARIATIONS: None - 36 -