Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hex Vexation
Message
From
03/05/1998 10:37:59
Mark Austen
Schooner Software Limited
Msida, Malta
 
 
To
03/05/1998 09:02:46
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00096588
Message ID:
00096590
Views:
20
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
Previous
Reply
Map
View

Click here to load this message in the networking platform