Qbasicnews.com

Full Version: Bug, I think
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
temp2 = 2
if not(temp1 or temp2 or temp3 or temp4 or dummy -> x or dummy -> x2) then
print "hello"
end if


for some reason this prints out "hello"

logically there is no values that would make that if statement true, right? I believe that those are bitwise OR statements. 2 OR x is can never be false.
I don't think NOT works that way anymore...
In that context, OR doesn't act as a bitwise operator but as a comparator. Take that in account.
Oh, then what does that OR statement do? I always though anything nonzero was true and true OR anything was always true. How do I change it to do what I want it to do? I want it to simply return false if any of the values are non zero.


EDIT: Does this still work the way I want?

Code:
temp2 = 2
asm
  mov eax, [temp1]
  or eax, [temp2]
  or eax, [temp3]
  or eax, [temp4]
  or eax, [dummy -> x]
  or eax, [dummy -> x2]
  mov [temp1], eax
end asm
if not (temp1) then print "hello"
The problem is that NOT is also bitwise. NOT 2 (10 in binary) = 11111111111111111111111111111101 in binary (in a 32-bit integer).
*smacks head* I've been doing too much programming in languages with boolean types. I gotta get my head back in the game.