While … Wend
Top  Previous  Next

While condition
statements
Wend 

Executes a series of statements as long as a given condition is TRUE.

Parameters
 
condition  
 
Expression that evaluates to TRUE or FALSE.  
 
statements  
 
One or more statements executed while condition is TRUE.  

Remarks


If condition is TRUE, all statements in statements are executed until the Wend statement is encountered. Control then returns to the While statement and condition is again checked. If condition is still TRUE, the process is repeated. If it is not TRUE, execution resumes with the statement following the Wend statement.  
Unlike For, While evaluates condition on every loop pass.  

Example


a = 10  
While a > 0  
       print "a = ", a  
       a = a - 1  
Wend