Hi everyone,
Perhaps someone could clarify the difference between a bitwise EQV and AND operation. Reading through the help file they sound as if they should be the same, but they are obviously not and I don’t understand why.
Here’s my test code which I was using to mess around with this as I’ve never really used it before and was interested in learning what I’d understood in principle!
Const BOLD = 1 ’ 0001
Const ITALIC = 2 ' 0010
Const UNDERLINE = 4 ' 0100
Dim style As Integer
style = BOLD+ITALIC ' 0011
' These AND's work as I would expect
MsgBox (style And BOLD) ' returns 1
MsgBox (style And ITALIC) ' returns 2
MsgBox (style And UNDERLINE) ' returns 0
' These EQV's I don't understand
MsgBox (style Eqv BOLD) ' returns -3
MsgBox (style Eqv ITALIC) ' returns -2
MsgBox (style Eqv UNDERLINE) ' returns -8
Cheers,
Craig.