I apologize if this is a very basic logic questions, but I saw some code in an example and I'm not understanding the logic structure, so I was hoping someone could explain it to me.
In my examples I'm using [Long]
simply as a representation for any Long data type object
The example looks like this:
NOTE: wHi, wLow, LoLo, HiLo, LoHI, and HiHI are all long variables.
If (wHi And &H8000&) Then
MAKELONG = (((wHi And &H7FFF&) * 65536) Or (wLow And &HFFFF&)) Or &H80000000
Else
MAKELONG = LoLO Or (&H10000 * LoHI)
'MAKELONG = ((wHi * 65535) + wLow)
End If
I'm not sure what condition is being tested here: if [long] and [long] then
and if [long] or [long] then
I also don't understand the return logic, e.g.: [LONG] = ([LONG] And [LONG]) or [LONG]
I tried playing in the immediate window and that did not shed any light on it for me as I did not see any obvious pattern:
?1 or 10
11
?2 or 10
10
?3 or 10
11
?4 or 10
14
? 1 and 10
0
?2 and 10
2
?3 and 10
2
?4 and 10
0
?5 and 10
0