While : Wend


Syntax
While <expression>
  ...
Wend
Description
Wend will loop until the <expression> becomes false. A good point to keep in mind with a While test is that if the first test is false, then the program will never enter the loop and will skip this part. A Repeat loop is executed at least once, (as the test is performed after each loop).

With the Break command it is possible to exit the While : Wend loop during any iteration, with the Continue command the end of the current iteration may be skipped.

Example

  b = 0
  a = 10
  While a = 10 
    b = b+1 
    If b=10 
      a=11 
    EndIf 
  Wend 
This program loops until the 'a' value is <> 10. The value of 'a' becomes 11 when b=10, the program will loop 10 times.