Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Decimal to hexadecimal
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00402852
Message ID:
00402876
Vues:
11
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform