Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
Logical Expressions
◄Up► ◄Contents► ◄Index► ◄Back►
─────Logical Expressions────────────────────────────────────────────────────
Logical expressions produce logical values. Basic operands used in
logical expressions are:
■ Logical constants or variables
■ Logical array-elements
■ Logical function references
■ Relational expressions
■ Integer constants or variables
Logical expressions are constructed from the basic operands and
logical operators.
Operator Operation Precedence
.NOT. Negation 1 (highest)
.AND. Conjunction 2
.OR. Inclusive disjunction 3
.XOR. Exclusive disjunction 4
.EQV. Equivalence 4
.NEQV. Nonequivalence 4
All of these are binary operators except .NOT., which is unary
and precedes its operand.
Logical operators allow only arguments of the LOGICAL type.
Microsoft FORTRAN also permits integer arguments, which may be
integer constants, integer variables, integer structure elements,
or integer expressions. Operations are "bitwise." For example,
the expression "k .XOR. m" performs an "exclusive-or" comparison
on matching bits in the operands, and sets or clears the
corresponding bit in the integer value it returns. If both
operands are not of the same integer type, the lower-precision
operand is converted to the higher-precision type.
The result of comparing two integer expressions with a logical
operator is of INTEGER type, not LOGICAL.
When two consecutive operations are of equal precedence, the
leftmost operation is performed first.
-♦-