Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP And Float data type
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00258195
Message ID:
00258296
Views:
13
Wow, you are good !! Thanks a lot. And now how do i convert the numeric value 1.9988 back to the string Chr(174)+chr(216)+chr(255)+chr(63)

A million tanks.

>That's a parameter type SINGLE, assuming that it's IEEE 754 compliant. As I remember, there's a bug related to the SINGLE parameter return value; Christof Lange and I have proven out the following code to convert a single contained in a VFP string (usually a part of a structure) back to a VFP numeric in straightforward fashion using RtlMoveMemory():
>
>
FUNCTION ConvertSINGLEToVFPNum
>LPARAMETER tcSingle
>* tcSingle is a 4 byte representation contained in a VFP string
>DECLARE RtlMoveMemory IN WIN32API AS RtlCopyDbl ;
>	SINGLE @DestNumeric, ;
>	STRING @pVoidSource, ;
>	INTEGER nLength
>LOCAL lnNum
>lnNum = 0.000000000000000
>=RtlCopyDbl(@lnNum, tcSingle, 4)
>RETURN lnNum
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform