Sheltran - WHILE construct


Form:

      WHILE <logical expression>
         <statement>...
    [    XWHILE 
         <statement>...      ] 
      CWHILE

Actions:

Whilst <logical expression> has a value .TRUE., the statements within the loop WHILE-CWHILE will be executed, and <logical expression> re-evaluated. When <logical expression> has a value .FALSE., control is transferred to the statement following CWHILE. At any point in the WHILE loop an XWHILE statement may be inserted. This statement transfers control to the statement following CWHILE independently of the value of <logical expression>.

Example:

      
      WHILE I.LE.72 
         CHR=LINE(I) 
         IF CHR.EQ.BLANK 
         THEN
            I=I+1 
         ELSE
            IF CHR.GE.'A'.AND.CHR.LE.'Z'
            THEN
               XWHILE
            CIF 
         CIF 
      CWHILE

Programming GIPSY