7-18
7.9.4 Logical Operator
The logical operator executes bit operations.
An operation is executed after values other than integer type are converted to
integer type.
Note: If a value out of the permissible range is designated for
integer type, an error occurs in execution.
Logical Operators
Logical operator Operation description
NOT Negation
AND Logical product
OR Logical addition
XOR Exclusive logical addition
Example: Bit operation
I1 = &B1100 XOR &B0101
The result of this example is &B1001.
NOTE: NOT operator
The NOT operator is one of the logical bit operators, so it cannot negate any
evaluation result of an expression such as I1=I2. (Refer to the
PROGRAMMER'S MANUAL, Subsection 7.9.4.)
The following sample cannot negate the evaluation result:
if NOT (I1=I2) then…
If the result of I1=I2 is Truth, the NOT operator cannot make it False.
To negate the evaluation result, write as follows:
if (I1=I2) = FALSE then…
7.9.5 Character String Operator
A character string can be linked with a character string operator “+”.
Example: A$ = “ABC” + “DEF” 'A$ becomes “ABCDEF”.
Comments to this Manuals