Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to read/convert 32-bit IEEE floating-point values
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00921059
Message ID:
00921098
Views:
22
Sergey,
thanks for the help but I can't get the Intiger function to run. I took out the double AS AS but I still get the error "Declare DLL caused an exception"
I tried moving the DECLARE to the top of the program so it would only be called once but still go the same thing. I also took the AS RtlCopyNum out completly and changed the name in the funciton but I still get the same thing.

I haven't tried the 64 bit floating point but what would I do to convert it to 32 bit? Or should I ask Dragan?
John.



>Hi John,
>
>
* Convert Long integer into VFP numeric variable
>	FUNCTION Long2Num(tcLong)
>	DECLARE RtlMoveMemory IN WIN32API AS  AS RtlCopyNum ;
>		Long @Dest, String @Source, Long Length
>	LOCAL lnNum
>	lnNum = 0
>	= RtlCopyNum(@lnNum, tcLong, 4)
>	RETURN lnNum
>	ENDFUNC
>
Check also Re: How to read a 32bit float from disk Message #569663
>
>>I am converting some data from an old system. I can write the records out to a text file but numeric fields are still in the raw format. I have confirmed that they are 32-bit IEEE floating-point and 32 bit Intiger. Does anyone know where I can find code to convert these? I need to read the 4 bytes and return the decimal value.
>>TIA
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform