HOW TO
ArcView can convert decimal numbers to a hexadecimal string with the .AsHexString request, but ArcView has no request to convert from hexadecimal string to a decimal number. This document provides a sample script to do this conversion.
Code:
'Prompt user for the input hexadecimal string
n = MsgBox.Input("","","")
decimal = 0
'Loop through the hexadecimal string
for each i in 0 .. (n.count-1)
dchr = n.middle(i,1).UCase.AsAscii
if (dchr < 65) then
dchr = dchr - 48 ' offset for numbers
else
dchr = dchr - 55 ' offset for letters
end
decimal = decimal * 16 + dchr
end
'Post the results
msgbox.info("result ="++decimal.asstring,"")
Article ID:000005056
Get help from ArcGIS experts
Download the Esri Support App