'v3.3***************************************************** ' File: Dez2Hex.vbs ' Autor: Hubert Daubmeier / hubertd@neusob.de ' http://www.neusob.de/scripting ' ' Wandelt eine Dezimal- in eine Hex-Zahl; für Zahlen von ' 0 bis 100 Milliarden. Bei Fließkommazahlen größer 2^53 ' könnte es zu Rundungsfehlern kommen. Bei Zahlen zw. ' 2^53 bis 2^96 müßte man evtl. auf den Datentyp Währung ' ausweichen. '********************************************************* Option Explicit MsgBox BigHex( 255 ) MsgBox BigHex( 2^52+1 ) MsgBox BigHex( 2^53-1 ) MsgBox BigHex( 2^53+1 ) Function BigHex(ByVal X) Dim A, D BigHex = "" A = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F") Do While X > 0 D = X - 16 * Fix(X / 16) BigHex = A(D) & BigHex X = (X - D) / 16 Loop If BigHex = "" Then BigHex = "0" End Function