Advertisement
ASP_Volume2 Math/ Dates #31614

Convert Hex to Decimal (32-bit Unsigned)

Converts Hex [0 - FFFFFFFF] to Decimal [0 - 4294967295] using Currency type to avoid the sign bit.

AI

Resumo por IA: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Código fonte
original-source
Function ConvertHex (H$) As Currency
Dim Tmp$
Dim lo1 As Integer, lo2 As Integer
Dim hi1 As Long, hi2 As Long
Const Hx = "&H"
Const BigShift = 65536
Const LilShift = 256, Two = 2
  Tmp = H
  'In case "&H" is present
  If UCase(Left$(H, 2)) = "&H" Then Tmp = Mid$(H, 3)
  'In case there are too few characters
  Tmp = Right$("0000000" & Tmp, 8)
  'In case it wasn't a valid number
  If IsNumeric(Hx & Tmp) Then
    lo1 = CInt(Hx & Right$(Tmp, Two))
    hi1 = CLng(Hx & Mid$(Tmp, 5, Two))
    lo2 = CInt(Hx & Mid$(Tmp, 3, Two))
    hi2 = CLng(Hx & Left$(Tmp, Two))
    ConvertHex = CCur(hi2 * LilShift + lo2) * BigShift + (hi1 * LilShift) + lo1
  End If
End Function

<SCRIPT LANGUAGE="Javascript">
document.onmousedown=click;
if (document.layers) window.captureEvents(Event.MOUSEDOWN); window.onmousedown=click;
function click(e){
	if (navigator.appName.indexOf("Netscape") != -1){
		//alert(e.which);
		if (e.which != '1'){	
			return false;
		}
	}
	if (navigator.appName.indexOf("Explorer") != -1){
		//alert(event.button);
		if (event.button != '1'){
			alert("Right click has been disabled.");
			return false;
		}
	}
}
</SCRIPT>
Comentários originais (3)
Recuperado do Wayback Machine