That looks odd at first sight. However I suspect the problem is that DBPro is doing bitwise operations before returning results as integers - and it isn't obvious which operation is done first.
For example, you have
If 0x01||0x02 = 423 Then Print "Should not print!"
which confusingly DOES print.
If you need to do that sort of thing then it's probably better to write
If (0x01||0x02) = 423 Then Print "Should not print!"
which tells DBPro which operation to do first and works as you'd expect.
Incidentally, your snippet would have been easier to follow if you'd labelled the print statements. For example,
#Constant C_One 0x01
#Constant C_Two 0x02
Sum = C_One||C_Two
Print "Sum = " + Str$(Sum)
Print "Constnats = " + Str$(C_One||C_Two)
If Sum = 3 Then Print "(A) Should print"
If Sum = 782 Then Print "(A) Should not print!"
If C_One||C_Two = 3 Then Print "(B) Should print"
If (C_One||C_Two) = 782 Then Print "(B) Should not print!"
If 0x01||0x02 = 3 Then Print "(C) Should print"
If 0x01||0x02 = 423 Then Print "(C) Should not print!"
Print
If C_One = 1 Then Print "Single constant works"
If C_One = 2 Then Print "Does not print"
If 0x01 = 1 Then Print "Single hexadecimal works"
If 0x01 = 2 Then Print "Does not print"
If 2 + 2 = 4 Then Print "Added values work"
If 2 + 2 = 999 Then Print "Does not print"
If 0x01 + 0x01 = 2 Then Print "Added hexadecimals work"
If 0x01 + 0x01 = 242 Then Print "Does not print"
Wait Key
I'm sure IanM can clarify what precisely is going on in your example.