Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Algorithm for converting hex-string in dec-string.
Message
From
07/05/2002 08:47:22
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
07/05/2002 08:39:55
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00653419
Message ID:
00653445
Views:
25
For converting the other way around (decimal to hex), see help on transform().

The algorithm - for doing it yourself - (shortcut method) is:

Divide repeatedly by 16. The remainders (in revers order) give you the hexadecimal number.

Example: 254

254 / 16 = 15, remainder 14 (digit "E")

15 / 16 = 0, remainder 15 (digit "F").

The hex number is FE.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform