letoiia
Messages postés40Date d'inscriptiondimanche 22 octobre 2000StatutMembreDernière intervention13 août 2008 5 févr. 2004 à 15:38
'Fonction de conversion d'entier en binaire
Public Function IntToBin(ByVal V As Long, Optional NbCarac As Byte = 16) As String
On Local Error GoTo Gestion_des_Erreurs
'***********************************************
'Déclaration
Dim I As Byte
Dim NewV As Long
'***********************************************
'Debut du Code
IntToBin = ""
NewV = V
For I = 1 To NbCarac
IntToBin = CStr(NewV Mod 2) & IntToBin
NewV = (NewV \ 2)
Next I
Exit Function
'*************************************************
'Gestion des Erreurs
Gestion_des_Erreurs:
Select Case Err.Number
Case Else
IntToBin = Empty
End Select
Exit Function
Resume
End Function