DO.WHILE

Synopsis
DO.WHILE instructionlist conditionlist
Description

Repeatedly evaluates the instructionlist as long as the evaluated conditionlist remains TRUE. DO.WHILE evaluates instructionlist before evaluating conditionlist, so instructionlist is always run at least once. The conditionlist input must contain an expression that evalautes to either TRUE or FALSE.

The fact that the conditionlist input is a list may be misleading, because it should contain exactly one expression. It is only a list because the contents of a list are not evaluated by default. Instead, they must be explicitly evaluated with RUN. This allows Logo to reevaluate conditionlist after each iteration, rather than only evaluating it once.

Example
MAKE "i 0
DO.WHILE [MAKE "I :i+1 PRINT :i] [:i<3]
1
2
3

SourceForge.net Logo