OpenBoot 2.x Quick Reference

do (Counted) Loop Commands

Table 1-35 do (Counted) Loop Commands

+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 ?do...loop to be executed 0 or more times. Index goes from start to end-1 inclusive. If end = start, loop is not executed.

do

( end start -- ) 

Begin a do...loop. Index goes from start to end-1 inclusive. Example: 10 0 do i . loop (prints 0 1 2...d e f).

i

( -- n ) 

Loop index. 

j

( -- n ) 

Loop index for next enclosing loop. 

leave

( -- ) 

Exit from do...loop.

loop

( -- ) 

End of do...loop.