1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Public Function Supervision1(ByVal bit As Integer, ByVal indice As Integer) As Integer
Dim nbc As Integer
Dim line As String
Dim Str As String
Dim nbByte As Integer
Dim i As Integer
Dim Start As Integer
Dim nval As Long
Dim Oct As Integer
Dim Rank As Integer
On Error Resume Next
Rank = indice
nbc = Len(bit) Mod 2
'Mise au format &Hxx -> on complète par 0 si besoin
Str = IIf(nbc = 1, "0" & bit, bit)
While Rank <= 31 And Len(Str) >= 8
Str = Mid(Str, Len(Str) - 4)
Rank = Rank - 16
End While
nval = Val("&H" & Str)
i = Val(Str And CStr(Hex(2 ^ Rank)))
Supervision1= IIf((nval And 2 ^ Rank) > 0, 1, 0)
End Function |
Partager