I would also note that you are converting a double to a float when assigning
total = dbl.d. I am not sure if that is causing an error, but otherwise I
don't see a problem.
Elia
-----Original Message-----
From: Tammy Cravit [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 03, 1999 3:00 PM
To: Palm Dev. Forum
Subject: Problem converting string to float
I am trying to convert a string to a float, using the FlpAToF routine as
described in the knowledge base (with gcc). I included NewFloatMgr.h in my
code, and then did the following:
FlpCompDouble dbl;
CharPtr foo;
float val;
FieldPtr fldP;
FormPtr frm;
frm = FrmGetActiveForm();
fldP = FrmGetObjectPtr(frm, FrmGetObjectIndex(frm, myField));
foo = FldGetTextPtr(fldP);
dbl.fd = FlpAToF(foo);
total = dbl.d;
When I run my program, foo gets set to "4.99" or whatever gets entered in
the
text field. dbl.fd as returned from FlpAToF gets set to "{high=0, low=0}"
according to gcc, and total gets set to 0.
Is there anything wrong with the code as I am writing it that would make
this
fail?
Thanks in advance,
Tammy
--
Tammy Cravit, MIS Manager
Davies Communications, Inc.
E-mail: [EMAIL PROTECTED]