Dec2Hex

Converts integer decimals into Hexadecimals

Function Dec2Hex(intDEC)
 dim strResult, intValue, intExp, arrDigits
 arrDigits     = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F")
 strResult     = ""
 intValue     = intDEC
 intExp      = 65536
 while intExp >= 1
  if intValue >= intExp then
   strResult   = strResult & arrDigits(int(intValue / intExp))
   intValue   = intValue - intExp * int(intValue / intExp)
  Else
   strResult   = strResult & "0"
  End if
  intExp     = intExp / 16
 Wend
 Dec2Hex    = strResult
End Function

intDEC

Views 2411 Downloads 831


ANmarAmdeen
589
Math Classic ASP
Revisions

v2.0