See description of logical (ie Boolean) variables in the PHENC entry on PIL
See also BOOLEAN, and LOGICAL variables in PIL, below. Each covers more or less the same ground.
The user can declare and use logical variables in the same way as INTEGERs and REALs. The default maximum number of logicals variables is 50, but this can be altered in SATLIT.
Variables are declared by the command BOOLEAN (LOGICAL already being a reserved PIL word); eg BOOLEAN(LOG1,LOG2,LOG3)
BOOLEAN variables are defaulted to F and are assigned by statements such as:
LOG1 = T
LOG2 = logical_expression
The following three kinds of simple logical_expression are permitted in PIL:
In this case implicit FLOATing is performed on integer values (ie the integer values are treated as real) and all FORTRAN operators are valid (ie all equalities and inequalities may be expressed); eg:
In this case a character variable enclosed by colons (:) inserts the current value of that variable into an expression. It should be noted that only the operators .EQ. and .NE. are valid in expressions of this type; eg:
Simple logical_expressions can be combined with the logical operators .AND., .OR. and .NOT. to create arbitrarily complex logical_expressions.
There are two limitations to the use of logical operators:
If, for example, the following PIL instructions are issued:
then the following are all valid assignments:
LOG1 = T
LOG1 = T.OR.F
LOG1 = CARTES
LOG1 = (CARTES.OR.(2*NX.EQ.NY))
LOG1 = NX.EQ.2
LOG1 = (CARTES.OR.(.NOT.((NX.GT.6).AND.(:CH1:.EQ.XYXZ))))
LOG1 = NX+NY+45.GE.NX-3
LOG1 = :CH1:.EQ.XXX
LOG1 = :CH2:.EQ.:CH1:ZZ
The values of individual variables can be ascertained by typing the variable name (as with integers and reals). Alternatively, typing SEE L and gives the values of all currently- declared logical variables respectively.