Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Decimal to hexadecimal
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00402852
Message ID:
00402921
Views:
10
Hi Doru,

Converting hex to binary is really trivial, and now that we know that convering
decimal to binary is also trivial, here's something that will convert a SINGLE hex digit to binary:


binary = substr( ;
"0000000100100011010001010110011110001001101010111100110111101111", ;
4*eval( "0x" + hex_character) + 1, 4)

If you want to convert something like "0x4AF15" simply convert the five digits individually and concatenate the result.

Thanks for the opportunity to redeem myself ;-)

Alex


>I'm watching this thread in hope it will get me out of my box...
>What I need, is to translate an asc() value 0 - 255, into a 'binary' string, i.e. asc('A') to be translated into '01000001'. We have a little UDF that does it, but I wonder if there is a more elegant solution.
>
>dz
Low-carb diet not working? Try the Low-food diet instead!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform