OpenBoot 3.x Command Reference Manual

do (Counted) Loop Commands

Table I-38 do (Counted) Loop Commands

Command 

Stack Diagram 

Description 

+loop

( n -- ) 

End a do+loop construct; add n to loop index and return to do (if n < 0, index goes from start to end, inclusive).

?do

( end start -- ) 

Begin ?doloop to be executed 0 or more times. Index goes from start to end-1, inclusive. If end = start, loop is not executed.

?leave

( flag -- ) 

Exit from a doloop if flag is non-zero.

do

( end start -- ) 

Begin a doloop. Index goes from start to end-1, inclusive.

Example: 10 0 do i . loop (prints 0 1 2...d e f).

i

( -- n ) 

Leaves the loop index on the stack. 

j

( -- n ) 

Leaves the loop index for next outer enclosing loop. 

leave

( -- ) 

Exit from doloop.

loop

( -- ) 

End of doloop.