At the risk of beating a dead horse, I'm going to try one more
time.  It appears that most are confused about this issue.  Some
say "NewFloatMgr does not work with gcc", some say "you cannot
use floats without using NewFloatMgr", etc, etc.  All far too
confusing.  Right now I am using NewFloatMgr.

I have tried to come up with the smallest example code as
an example of my question.  This example has one form, one field 
(fldFloat), one button.  All it does is execute DoFloat() when
the button is pressed.  If the answer is correct it displays
correct and incorrect if the answer is incorrect.  This way
I do not have to rely on FToA functions of NewFloatMgr.

When I press the button, "correct" is displayed.  I have changed
the values of fp1 to get an incorrect answer and recompiled. 
Using that new value for fp1, "incorrect" is displayed.

But let me ask this question:  Using gcc, and not using any
special compiler options and NOT including NewFloatMgr.h, and
using gcc NOT CW, does this code represent the use of floats without
NewFloatMgr?

If not what am I missing?  Any comments would be appreciated.  

static void DoFloat()
{
  FormPtr frmP;
  FieldPtr fldP;
  float fp1, fp2, fp3;

  fp1 = 21.525;
  fp2 = 22.475;
  fp3 = fp1 + fp2;

  if(fp3 == 44.0)
  {
    fldP = FrmGetObjectPtr(FrmGetActiveForm(),
        FrmGetObjectIndex(FrmGetActiveForm(), fldFloat));
    FldInsert(fldP, "Correct", 7);
  }
  else
  {
    fldP = FrmGetObjectPtr(FrmGetActiveForm(),
        FrmGetObjectIndex(FrmGetActiveForm(), fldFloat));
    FldInsert(fldP, "Incorrect", 9);
  }
}


----------------------------------------------------
Shoot-to-Win

Protect the 2nd Amendment
----------------------------------------------------

Reply via email to