Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hex Vexation
Message
De
03/05/1998 10:37:59
Mark Austen
Schooner Software Limited
Msida, Malta
 
 
À
03/05/1998 09:02:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00096588
Message ID:
00096590
Vues:
21
Dale,

For converting decimal to hexadecimal I wrote the function Dec2Hex using a substr lookup rather than any other method so it's quite quick. To convert your character based numbers see the code below.

Hope this is what you were looking for.


Regards,

Mark Austen
[Schooner Software Limited]
lcChar = "E4"
?Dec2Hex(asc(left(lcChar, 1))) + Dec2Hex(asc(right(lcChar, 1)))
*
*--------------------------------------------------------------------------
function Dec2Hex
*--------------------------------------------------------------------------
*
lparameters ;
   tnDec
*
return ;
   substr("0123456789ABCDEF", int(tnDec / 16) + 1, 1) + ;
   substr("0123456789ABCDEF", (tnDec % 16) + 1, 1)
*
*
*--------------------------------------------------------------------------
*--------------------------------------------------------------------------
Regards,

MarkA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform