Warning

You're browsing the old v2.x documentation. This version is no longer maintained. Click here to go the v3.x documentation.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
while [2019/07/15 10:14] – created neilswhile [2019/09/06 07:03] (current) neils
Line 5: Line 5:
 Syntax: Syntax:
  
-  while <conditional expression>+  while <condition>
     <statements>     <statements>
   endwhile   endwhile
      
-The ''WHILE'' command opens a pre-test loop where the given condition is evaluated every time before entering the loop. If the condition evaluates to true, the statements between ''WHILE'' and ''ENDWHILE'' will be executed and the condition will be tested again . If it evaluates to false, the statements will be skipped and execution will be continued after the ''ENDWHILE'' statement.+The ''WHILE'' command starts **pre-test loop** where the given condition is evaluated every time before entering the loop. If the condition evaluates to true, the statements between ''WHILE'' and ''ENDWHILE'' will be executed and the condition will be tested again . If it evaluates to false, the statements will be skipped and execution will be continued after the ''ENDWHILE'' statement
 + 
 +Contrarily to the ''[[fornext|FOR ... NEXT]]'' loop, it is allowed to escape from the ''WHILE'' loop using the ''[[goto|]]'' command.
  
 Example: Example:
Line 20: Line 22:
   endwhile   endwhile
      
-**Note**: for a post-test loop, see ''[[repeat|REPEAT ... UNTIL]]''.+**Note**: for a **post-test loop**, see ''[[repeat|REPEAT ... UNTIL]]''.