System Functions
AND( ) Logical AND
 
Format 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,
value2[$] value1$ must be the same length as value2$
 
Returns Result of bit-wise logical 'AND' comparison of two expressions/variables.
 
Description 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 ProvideX returns an Error #46: Length of string invalid.
 
Binary Result
 
0 and 0 0
 
1 and 0 0
 
0 and 1 0
 
1 and 1 1
 
See Also IOR( ) OR Comparison
XOR( ) Exclusive OR Comparison
 
Example 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"