I have two If statements using the NOT operator:
1) If Not 3 And &H88 Then
2) If Not 15 And &H88 Then
In both cases control goes into the If clause.
What confuses me is the result of (1) is 0 (3 And &H88 = 0) which to me would cause control to enter the If clause but the results of (2) is 8 (15 And &H88 = 8) which to me should skip the If clause and exit out.
I'm trying to mimic some C code and the C code is this:
Now when the above is executed the first time isqFrom = 4, *pvec points to memory that contains the value -1 and the results in isqTo is 3 and after the & 0x88 control enters the if clause just like it does in the VB example. Now the second time the if is executed isqFrom = 1, *pvec = 14 and isqTo = 15 and after the & 0x88 control skips out of the if statement.Code:if(!((isqTo = isqFrom + *pvec) & 0x88)) { ' ' }
So, in the VB I have this:
The variables in the VB code are the same as they are in the C codeCode:' ' isqTo = isqFrom + pvec(i) If isqTo > 0 Then ' ' 1st time isqTo is 3 ' 2nd time isqTo is 15 If Not isqTo And &H88 Then ' ' ' End If End If ' '




Reply With Quote