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:

 

.NOT.

.AND.

.OR.

 

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.

 

COMMENTS

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.

 

EXAMPLES

 

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

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

.NOT. .FALSE. = .TRUE.

 

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

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

.NOT. .TRUE. = .FALSE.

 

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

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

 

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

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

 

 


Page url: http://www.cassoftware.com/tas/manual/booleanoperators.htm