• Syntaxes:
      WHILE <exp>
        <statements>
      ENDWHILE
    
      WHILE <exp> DO <statements>     // see DO
    

    While <exp> is true all <statements> are processed. If <exp> is false, loop leaves.
      WHILE <exp1>
        <statements1>
      ELSEWHILE <exp2>
        <statements2>
      ALWAYS
        <statements>
      ENDWHILE
    

    If <exp1> is true, <statements1> are processed, if no <exp2> is tested and it the result is true <statements2> are processed. Then if atleast one of <exp1> and <exp2> is true <statements> are processed. Loop leaves when neither <exp1> nor <exp2> is true. Multiple ELSEWHILEs are allowed and ALWAYS can be left.
    If You add 'N' after WHILE or ELSEWHILE, the result of contition will be negated:
      WHILE a<b
      ELSEWHILE a=0
    

    is the same as
      WHILEN a>=b
      ELSEWHILEN a
    
  • Returning values:
    WHILE loop can return list of values, just add the return list after ENDWHILE keyword:
      ENDWHILE <list>
    
  • Early exit:
    EXIT/EXITIF keyword