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 programme 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).

Example :

  b = 0
  a = 10
  While a = 10 
    b = b+1 
    If b=10 
      a=11 
    Endif 
  Wend 

This programme loops until the 'a' value is <> 10. A change here when b=10, the programme will loop 10 time.