4.7. WHILE

Syntax:


        WHILE lexpr LOOP
          statement_block
          [ EXIT LOOP ]
        END LOOP
      

statement_block will be executed as long as lexpr evaluates to a 1, or until [EXIT LOOP] is encountered. This is similar to REPEAT above, the difference being the statement_block of REPEAT loop will always execute at least once, whereas that of a WHILE loop may never execute (because the test is done first).

Example:


        WHILE no_button LOOP
          xx = xx + 1
          IF (xx == 10) THEN
            EXIT LOOP
          END IF
        END LOOP