Navigation:  System Specifications >

Boolean Operators

Print this Topic Previous pageReturn to chapter overviewNext page


These are used in logical expressions and can only affect the logical values, .TRUE. or .FALSE.  All Boolean values start and end with a period.  There must always be a space before and after the operator in any expression.  Here are the Boolean operators in order of precedence:






The .NOT. operator basically inverts the truth value.  For example, .NOT. .TRUE. is equivalent to false (or .FALSE.).  The .AND. operator only returns true if both arguments are true (.TRUE.).  Thus .TRUE. .AND. .TRUE. would return .TRUE.  The .OR. operator returns true if either argument is true.  More examples are given below.  Please note that you can alter the order of evaluation using parentheses; nest the operators in parentheses if you want to be completely certain.



The operators/values .T., .F., .N., .A. and .O. can also be used instead of .True., .False., .Not., .And. and .Or.


NOTE:  You can use True and False without the leading and trailing periods also, but just for those two Boolean values.




.FALSE. .OR. .FALSE. = .FALSE.                

.FALSE. .AND. .FALSE. = .FALSE.                




.FALSE. .AND. .TRUE. = .FALSE.                



.TRUE. .OR. .FALSE. = .TRUE.                



.TRUE. .OR. .TRUE. = .TRUE.                




Page url: