AND( ) |
Logical AND |
AND(value1[$],value2[$][,ERR=stmtref])
Where:
stmtref |
Program line number or statement label to which to transfer control. |
value1[$] |
Compared values. String or numeric expressions/variables. If strings, value1$ must be the same length as value2$. |
Result of bit-wise logical 'AND' comparison of two expressions/variables.
The AND( ) function performs a bit-wise 'AND' comparison of two string or numeric expressions/variables and generates a value as a result. The length of the two string expressions must be equal or PxPlus returns an Error #46: Length of string invalid.
Binary |
Result |
0 AND 0 |
=0 |
0 AND 1 |
=0 |
1 AND 0 |
=0 |
1 AND 1 |
=1 |
IOR( ) OR Comparison
XOR( ) Exclusive OR Comparison
0040 read (1,end=1000) F$
0050 R$=and(F$(1,2),$7F7F$) ! Turn off high bit
0060 ....
BITS$=$03$
if and(BITS$,$02$)=$02$ \
then print "bit 2 is on"