1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| 'Change la valeur des 2 bits spécifiés de fBitFields
Private Sub SetfBitFieldsByte(ByRef MyfBitFields As Int32, MyVal As Byte, MyStartBitNumber As Int16)
Dim Bit0, Bit1 As Boolean
Select MyVal
Case 0
Bit0 = False
Bit1 = False
Case 1
Bit0 = True
Bit1 = False
Case 2
Bit0 = False
Bit1 = True
Case 3
Bit0 = True
Bit1 = True
Case Else
Exit Sub
End Select
SetfBitFieldsBoolean(MyfBitFields, Bit0, MyStartBitNumber)
SetfBitFieldsBoolean(MyfBitFields, Bit1, Ctype(MyStartBitNumber + 1,Int16))
End Sub |
Partager