Developer Guide and Reference

ID 767251
Date 10/31/2024
Public
Document Table of Contents

Logical Assignment Statements

For logical assignment statements, the variable must be of logical type and the expression can be of logical or numeric type.

If the expression is of numeric type, it is converted to integer if necessary, then the value is interpreted as .TRUE. or .FALSE. according to the setting of the compiler option fpscomp logicals.

Examples

The following examples demonstrate valid logical assignment statements:

PAGEND = .FALSE.
PRNTOK = LINE .LE. 132 .AND. .NOT. PAGEND
ABIG = A.GT.B .AND. A.GT.C .AND. A.GT.D
LOGICAL_VAR = 123 ! Assigns .TRUE. to LOGICAL_VAR