Hi,
I have lines like;
blah (apple OR banana OR orange OR peach)
and similarly:
blah (apple AND banana AND orange AND peach)
When using the suggestions does it matter if they are 'done' in different orders? In other words, if I first (apple OR banana) then (orange OR peach) then (res1 OR res2) or 'say' OR each fruit as I go along? Similarly for AND.
C.
I hate to bring this up as it confuses the situation. Some C code defines constants as binary then ANDs them together to pass to a function as a single byte.
E.G.
I hate to bring this up as it confuses the situation. Some C code defines constants as binary then ANDs them together to pass to a function as a single byte.
E.G.
Hi Eric,
My mind is so blocked with OPERATORS, that I am not seeing the wood for the trees.
Thanks for your examples. Of course, I use these all of the time
C.
Sorry.. correct if the arguments were boolean it would work..
Code:
dim aa as byte
dim ab as byte
dim ac as byte
dim res1 as byte
dim res2 as byte
res2 = aa and ab
res 1 = aa and ac
res1 = not res1
if res2>0 and res1>0 then
PORTB = 255
else
PORTB = 0
endif
end
Dim aa As Byte
aa = %10101011
Dim ab As Byte
ab = %00000110
Dim ac As Byte
ac = %00000011
Dim ad As Byte
ad = %00001010
Dim result1 As Byte
Dim result2 As Byte
Dim result3 As Byte
'IF ((aa and ab) AND (NOT (aa and ac ))) NOTE: [and is bitwise] [AND is Boolean] [NOT is Boolean]
result1 = aa And ab 'bitwise AND
result2 = aa And ac 'bitwise AND
result2 = Not result2 'Boolean NOT
If result1 > 0 And result2 > 0 Then 'Boolean AND
result3 = 255
Else
result3 = 0
Endif
End