Private Function GetByteData(ByVal btSrc As Byte, ByVal intPos As Byte) Select Case intPos Case 0 GetByteData = btSrc And &H1 Case 1 If (btSrc And &H2) = &H2 Then GetByteData = 1 Else GetByteData = 0 End If Case 2 If (btSrc And &H4) = &H4 Then GetByteData = 1 Else GetByteData = 0 End If Case 3 If (btSrc And &H8) = &H8 Then GetByteData = 1 Else GetByteData = 0 End If Case 4 If (btSrc And &H10) = &H10 Then GetByteData = 1 Else GetByteData = 0 End If Case 5 If (btSrc And &H20) = &H20 Then GetByteData = 1 Else GetByteData = 0 End If Case 6 If (btSrc And &H40) = &H40 Then GetByteData = 1 Else GetByteData = 0 End If Case 7 If (btSrc And &H80) = &H80 Then GetByteData = 1 Else GetByteData = 0 End If End Select End Function
Select Case intPos
Case 0
GetByteData = btSrc And &H1
Case 1
If (btSrc And &H2) = &H2 Then
GetByteData = 1
Else
GetByteData = 0
End If
Case 2
If (btSrc And &H4) = &H4 Then
GetByteData = 1
Else
GetByteData = 0
End If
Case 3
If (btSrc And &H8) = &H8 Then
GetByteData = 1
Else
GetByteData = 0
End If
Case 4
If (btSrc And &H10) = &H10 Then
GetByteData = 1
Else
GetByteData = 0
End If
Case 5
If (btSrc And &H20) = &H20 Then
GetByteData = 1
Else
GetByteData = 0
End If
Case 6
If (btSrc And &H40) = &H40 Then
GetByteData = 1
Else
GetByteData = 0
End If
Case 7
If (btSrc And &H80) = &H80 Then
GetByteData = 1
Else
GetByteData = 0
End If
End Select
End Function