Hace mucho en este mismo foro se crearon cientos de funciones...
Código
' ' //////////////////////////////////////////////////////////////// ' // Autor: BlackZeroX ( Ortega Avila Miguel Angel ) // ' // // ' // Web: http://InfrAngeluX.Sytes.Net/ // ' // // ' // |-> Pueden Distribuir Este Código siempre y cuando // ' // no se eliminen los créditos originales de este código // ' // No importando que sea modificado/editado o engrandecido // ' // o achicado, si es en base a este código // ' //////////////////////////////////////////////////////////////// Option Explicit Enum ActionsHexStr HexToString = 0 StringToHex End Enum Public Function HexAndString(ByVal vData As String, Optional Accion As ActionsHexStr = HexToString) As String Dim LenBuffer As Long Dim LenOfBuffer As Integer Dim Puntero As Long Dim I As Long Dim vStep As Integer If CBool(IIf(Accion = HexToString And (Len(vData) Mod 2) = 0, True, IIf(Accion = StringToHex, True, False))) Then LenBuffer = IIf(Accion = HexToString, Len(vData) / 2, Len(vData) * 2) LenOfBuffer = IIf(Accion = HexToString, 1, 2) HexAndString = Space(LenBuffer) vStep = IIf(Accion = HexToString, 2, 1) Puntero = 1 For I = 1 To Len(vData) Step vStep If Accion = HexToString Then Mid(HexAndString, Puntero, LenOfBuffer) = Chr$(Val("&H" & Mid$(vData, I, 2))) Puntero = Puntero + 1 Else Mid(HexAndString, Puntero, LenOfBuffer) = Hex$(Asc(Mid$(vData, I, 1))) Puntero = Puntero + 2 End If Next I End If End Function
P.D.: Cuando termine de re-diseñar y de re-programar mi sitio host de archivos (FileX) vuelvo a montar mi blog.
Dulces Lunas!¡.