Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Hexa TO Decimal in VFP codes
Message
 
To
23/10/2002 17:22:21
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00714573
Message ID:
00714579
Views:
37
>I have someone gave me a sample of the conversion of Hexa to Decimal numbers:
>
> 0100608F1A3A44 gave 736125 in decimal
> 0100608F2C5975 gave 738440
> 0100608F242034 gave 737392
> 0100608F180810 gave 735844
> 0100608F26889E gave 737700
> 0100608F21798A gave 737052
>
>How can we do this in VFP ? please help in coding that would be appreciated
>very much.

Hi Paul

First of all, the above table is not a conversion from hexa to decimal, or it has been truncated due to some overflow
Check the first line results using Windows Calculator (scientific mode)

0100608F1A3A44 hexa = 281889694431812 decimal
736125 decimal = 000B3B7D hexa

If you want to convert hexa to decimal (and back) in VFP you can do it this way:
dec = 1000
? Transform(dec,"@0")   && prints "0x000003E8"

hex = "3E8"
? Evaluate("0x"+hex)    && prints 1000
Hope this helps and bye,
------------------
Jose Marcenaro
Tercer Planeta - Argentina
http://www.tercerplaneta.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform