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:
00402876
Views:
10
>Does VFP have function to convert Decimals values to Hexadecimals values?

Jean-Rene,

As Nigel pointed out the TRANSFORM() function can do this, but there's extra work involved if the value is less than zero, you'll get stars (overflow). Try this out from the command window:
lnval = 0xFFFFFFFF
? lnval && 4294967295
? TRANSFORM(lnval, "@0x") && 0xFFFFFFFF
lnval = BITOR(lnval, lnval)
? lnval && -1
? TRANSFORM(lnval, "@0x") && **********
So it all depends on whether or not it's a signed integer, which as the code shows can happen without you're being aware of it.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform