What you really need are functions to convert between double and string.
Leon
Glenn Bachmann wrote:
>
> Hello,
>
> We are looking to take some fairly complex legacy code that is riddled with
> variables of type "double", and integrate it with some new user interface
> code that uses FlpDouble to enable easy ascii conversions. We are using
> NewFloatMgr and have set 8-bit doubles to be on.
>
> Our understanding is that "double" will work fine using NewFloatMgr and
> CodeWarrior 5+, but that we should be using the Flp apis to enable ascii
> conversion. What is missing for us is a way to convert back and forth
> between FlpDouble and double (I'm guessing a simple cast will not work!).
>
> Essentially we want to do this:
>
> CalcSomething ( void )
> {
> FlpDouble fdA;
> FlpDouble fdB;
> double dResult;
> char string1[20];
> char string2[20];
>
> // get values from user input fields into strings
>
> // convert string1 to an FlpDouble using FlpAToF ( fdA, string1 );
> // convert string2 to an FlpDouble using FlpAToF ( fdB, string2 );
>
> // convert FlpDoubles into doubles
> dA = FlpConvertToDouble ( fdA ); // does this function exist????
> dB = FlpConvertToDouble ( fdB ); // does this function exist????
>
> // pass to calc routine
> dResult = fooCalcSomethingReallyComplex (dA, dB);
>
> // convert double result into FlpDouble
> fdResult = FlpConvertToFlpDouble ( dResult ); // does this function exist?
>
> // convert FlpDouble into a string using FlpFToA ( stringResult, fdResult );
>
> // display results
> WinDrawChars (...);
>
> return;
> }
>
> Is there such a thing as FlpConvertToDouble/ConvertToFlpDouble? If not, how
> would I convert from double to FlpDouble and back?
>
> Thanks,
>
> Glenn Bachmann
> Bachmann Software and Services, LLC
> http://www.bachmannsoftware.com
> Software for Handheld & Wireless Computing, Windows and the Internet
> Authors of "Palm Programming", published by Macmillan/Sams, and home of
> Bachmann Print Manager, the only graphical printing solution for the Palm
> Computing Platform