question about data values (bit vs decimal)
Jeff was kind enough to send me the EZIO8SA script that he uses.
I would like to ask someone though to explain the logic for the if-then test. For the following excerpt, I need to understand the bit-to-decimal conversion within Jon's and Jeff's code:
If (Val("&H" & Data(12)) And &H01) <> &H01 Then ' input 1 is not set
End If
If (Val("&H" & Data(12)) And &H02) <> &H02 Then ' input 2 is not set
End If
If (Val("&H" & Data(12)) And &H04) <> &H04 Then ' input 3 is not set
End If
If (Val("&H" & Data(12)) And &H08) <> &H08 Then ' input 4 is not set
End If
In this logic, &H01 applies to input 1, &H02 applies to input 2, &H04 applies to input 3, etc. I assume that &H16=input 5, &H32=input 6, etc. Is this correct? Can anyone elaborate further?
Thanks, Blake
Jeff was kind enough to send me the EZIO8SA script that he uses.
I would like to ask someone though to explain the logic for the if-then test. For the following excerpt, I need to understand the bit-to-decimal conversion within Jon's and Jeff's code:
If (Val("&H" & Data(12)) And &H01) <> &H01 Then ' input 1 is not set
End If
If (Val("&H" & Data(12)) And &H02) <> &H02 Then ' input 2 is not set
End If
If (Val("&H" & Data(12)) And &H04) <> &H04 Then ' input 3 is not set
End If
If (Val("&H" & Data(12)) And &H08) <> &H08 Then ' input 4 is not set
End If
In this logic, &H01 applies to input 1, &H02 applies to input 2, &H04 applies to input 3, etc. I assume that &H16=input 5, &H32=input 6, etc. Is this correct? Can anyone elaborate further?
Thanks, Blake
Comment