Converts an integer to a string based on a set base
--Based on scripts by Kevan Dettelbach and Chuck Neal
--Convert a positive integer in a String based on base
-- for int-to-hex call ConvBase(nConv, 16)
-- for int-to-bit call ConvBase(nConv, 2)
on convBase nConvNum, nBase
if (nBase > 1 and nBase < 17) and (nConvNum > -1) then
baseNums = ["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"]
szConverted = ""
repeat while nConvNum
nMod = nConvNum mod nBase
szConverted = baseNums[nMod + 1] & szConverted
nConvNum = nConvNum / nBase
end repeat
return szConverted
else
return VOID
end if
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA