Library /sys$common/syshlp/DTRHELP.HLB  —  Boolean Expressions, Boolean Operators
       There are four Boolean operators: AND, OR, NOT, and BUT. With
       AND, OR, and BUT, you can join two or more Boolean expressions to
       form a single Boolean expression. NOT allows you to reverse the
       value of a Boolean expression.

       The AND and BUT operators perform the same function. If you link
       Boolean expressions with either AND or BUT, the resulting Boolean
       expression is true only if all the Boolean operators linked with
       either AND or BUT are true.

       If you link Boolean expressions with OR, the resulting Boolean
       expression is true if any one of the Boolean linked with OR are
       true.

       If you precede a Boolean expression with NOT, the resulting
       Boolean expression is true if the Boolean expression following
       NOT is false.

       The following examples show the use of Boolean operators:

       DTR> READY YACHTS
       DTR> PRINT YACHTS WITH BUILDER = "PEARSON" AND LOA = 30

                                      LENGTH
                                       OVER
       MANUFACTURER   MODEL     RIG    ALL   WEIGHT BEAM  PRICE

        PEARSON     30         SLOOP   30     8,320  09

       DTR> FIND YACHTS WITH BUILDER = "PEARSON" OR LOA = 30
       [21 records found]

       DTR> READY FAMILIES
       DTR> PRINT FAMILIES WITH FATHER NOT EQ "JIM" AND
       [Looking for Boolean expression]
       CON> ANY KIDS WITH AGE GT 31

                             NUMBER    KID
         FATHER     MOTHER    KIDS     NAME    AGE

       JEROME     RUTH          4   ERIC       32
                                    CISSY      24
                                    NANCY      22
                                    MICHAEL    20
       HAROLD     SARAH         3   CHARLIE    31
                                    HAROLD     35
                                    SARAH      27

       DTR>

       You can also use parentheses to group Boolean expressions. DEC
       DATATRIEVE evaluates Boolean expressions in parentheses before
       evaluating other Boolean expressions. If a Boolean expression
       contains Boolean operators as well as parentheses, DEC DATATRIEVE
       evaluates the Boolean expression in the following order:

       1. Expressions enclosed in parentheses

       2. Expressions preceded by NOT

       3. Expressions combined with AND or BUT

       4. Expressions combined with OR
Close Help