DTRHELP.HLB  —  Commands Statements Clauses, WHILE Statement
       Causes DEC DATATRIEVE to repeat a statement as long as the
       condition specified in the Boolean expression is true.

       Format

         WHILE  boolean-expression statement

1  –  Arguments

    boolean-expression

       Is a Boolean expression. In the WHILE statement, Boolean
       expressions are limited to the following format:
       { variable-name }
       { *.prompt      } boolean-operator  value-expression
       {               }

    statement

       Is a simple or compound statement you want DEC DATATRIEVE to
       execute if the Boolean expression evaluates to true.

2  –  Example

       The following example groups the boats with LOA less than 35
       according to the value of BEAM and displays the TYPE, LOA, and
       BEAM of the shortest boat from each group of boats with the same
       value for BEAM:

       DTR> SHOW WHILE_EX
       PROCEDURE WHILE_EX
       BEGIN
       DECLARE X PIC 99.
       X = 0
       FOR YACHTS WITH LOA < 35 AND
           BEAM NE 0 SORTED BY BEAM, LOA
           WHILE X < BEAM
           BEGIN
               PRINT TYPE, LOA, BEAM, X
               X = BEAM
           END
       END
       END_PROCEDURE

       DTR> :WHILE_EX

                               LENGTH
                                OVER
       MANUFACTURER   MODEL     ALL   BEAM X

       CAPE DORY    TYPHOON     19     06  00
       WINDPOWER    IMPULSE     16     07  06
       ERICSON      23/ SPECIA  23     08  07
       EASTWARD     HO          24     09  08
       ALBIN        79          26     10  09
       BOMBAY       CLIPPER     31     11  10
       IRWIN        25          25     12  11

       DTR>
Close Help