From: "Chris Antos" <[EMAIL PROTECTED]>
> i'm pretty this means you used FldSetTextPtr on the field, without
> subsequently calling FldRecalculateField.
You are right, in that I used FldSetTextPtr on that field. But the
problem turned out to be that I passed a pointer that was actually
'name' for the array 'name[size]'. That array only existed within
an initializing routine. I moved the array to make it global and
the problem went away.
But I have a follow-up question relating to lifetime requirements on
text that is displayed in fields.
In my original problem, I have two fields that are both non-editable
and both text values were created in the same routine. Both text
values were placed in their respective fields in the same routine.
Only one exhibited the problem mentioned below.
For that field (the one that did not have a problem), I used: char *
code; but 'code' is just the return value from another function and
what it points to is a local array within that function; and for the
one that had the problem I used: char name[size]. For both fields
it seems that my source text is temporary.
Why does one produce the error 100% (one with array) and the other
never has the error (pointer to char)? Or is it just by luck that
one works?
I guess my question is, does the source (where the text originated)
of the field data have to remain for the lifetime of the displayed
field?
>
>
> ----- Original Message -----
> From: Mike Davis <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, June 12, 1999 6:07 PM
> Subject: Strange Field Error Problem in POSE
>
>
> > I am having a problem tracking down an error discovered
> > using POSE. This error does not occur on the actual Palm.
> >
> > I have a Form that has a field that simply displays the User
> > Name. It's properties: Usable=T, Editable=F, Enable=T. The form has
> > three fields and two buttons. The event handler has code for opening
> > the form and responding to the two buttons; that's it; very simple.
> >
> > I do not have any event handlers that have anything to do with this
> > field. But POSE apparently taps in this field. And that causes the
> > error.
> >
> > So, I tried this without POSE. I open the form, then tap the User
> > Name field and sure enough the same error is generated. But I cannot
> > determine why it occurs or how to fix it.
> >
> > The error reported is: "... line 100, invalid field length...".
> >
> > I have other fields and none of these exhibit this problem. All
> > properties on all three fields are the same except that the User Name
> > field is not editable. Everything else on the form works as it should.
> >
> > Any tips on why I might get this error by simply tapping a field with my
> > pen?
> >
> > Here is the event handler:
> > file://***********************************************************
> > static Boolean frmRegEventH(EventPtr event) {
> > FormPtr form;
> > FieldPtr fldP;
> > Word fldIdx;
> > ControlPtr ctlP;
> > int handled = 0;
> >
> > CALLBACK_PROLOGUE
> > form = FrmGetActiveForm();
> > switch (event->eType) {
> > case frmOpenEvent:
> > FrmDrawForm(form);
> > if(FrmGetFormId(form) == frmRegister) {
> > RegFormInit(form);
> > }
> > handled = 1;
> > break;
> > case ctlSelectEvent:
> > if (event->data.ctlEnter.controlID == btnRegRegister ) {
> > // if btnRegRegistered is pressed do something here
> > handled = 1;
> > break;
> > }
> > if (event->data.ctlEnter.controlID == btnRegOk ) {
> > // if btnRegOk is pressed return to main form
> > FrmReturnToForm(frmMain);
> > handled = 1;
> > break;
> > }
> > break;
> > }
> > CALLBACK_EPILOGUE
> > return handled;
> > }
> >
> > --
> > -----------------------------------------------------------------
> > Discussion Group: http://www.halcyon.com/ipscone/wwwboard/
> >
> > Protect your constitutional rights. Your favorite one may be next!
> > -----------------------------------------------------------------
> >
>
>
--
-----------------------------------------------------------------
Discussion Group: http://www.halcyon.com/ipscone/wwwboard/
Protect your constitutional rights. Your favorite one may be next!
-----------------------------------------------------------------