Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convertion
Message
 
To
11/01/2001 11:13:58
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00462269
Message ID:
00462515
Views:
12
>I need to convert an hexadecimal(16) number in decimal(10). How ?
First of all, i think you mean hex(10) = dec(16)
what you can do is something like this

(VFP code, but it is for the idea)
decimal = 0
for i = 1 to len(hexstring)
   lchexnumber = substr(hexstring,i,1)
   lnhexnumber = at(lcHexNumber,'0123456789ABCDEF') - 1 && or another variant of this
   decimal = decimal * 16 + lnhexnumber
endfor
Previous
Reply
Map
View

Click here to load this message in the networking platform