You are on page 1of 1

'var debug1 = true;

'var debug2 = true;


'var escapeMap = '';
'var CPstring = '';
'
'
'var hexNum = { 0:1, 1:1, 2:1, 3:1, 4:1, 5:1, 6:1, 7:1, 8:1, 9:1,
' A:1, B:1, C:1, D:1, E:1, F:1,
' a:1, b:1, c:1, d:1, e:1, f:1 };
'var jEscape = { 0:1, b:1, t:1, n:1, v:1, f:1, r:1 };
'var decDigit = { 0:1, 1:1, 2:1, 3:1, 4:1, 5:1, 6:1, 7:1, 8:1, 9:1 };

'function dec2hex ( textString ) {


' return (textString+0).toString(16).toUpperCase();
'}

Function dec2hex (ByVal textString As Integer) As String


Return Hex(textString)
End Function

'function dec2hex2 ( textString ) {


' var hexequiv = new Array ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D",
"E", "F");
' return hexequiv[(textString >> 4) & 0xF] + hexequiv[textString & 0xF];
'}

Function dec2hex2(ByVal textString As Integer) As String


Dim hexequiv(0 To 15) As String*1 = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
"A", "B", "C", "D", "E", "F"}
Return hexequiv((textString Shr 4) And &HF) + hexequiv(textString And &HF)
End Function

'function dec2hex4 ( textString ) {


' var hexequiv = new Array ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D",
"E", "F");
' return hexequiv[(textString >> 12) & 0xF] + hexequiv[(textString >> 8) & 0xF] +
hexequiv[(textString >> 4) & 0xF] + hexequiv[textString & 0xF];
'}

Function dec2hex4(ByVal textString As Integer) As String


Dim hexequiv(0 To 15) As String*1 = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
"A", "B", "C", "D", "E", "F"}
Return hexequiv((textString Shr 12) And &HF) + hexequiv((textString Shr 8) And
&HF) + hexequiv((textString Shr 4) And &HF) + hexequiv(textString And &HF)
End Function

You might also like