> I think so.
> Here is the code (snippet)
> ===============
> case AddNoteDoneButton: //Save the data and leave the form
> frm = FrmGetActiveForm();
> wIDField=FrmGetObjectIndex(frm,AddNoteNoteField);
> pCtlField=(FieldPtr) FrmGetObjectPtr(frm,wIDField);
> FldCompactText(pCtlField);
> textLen=FldGetTextLength(pCtlField);
> if (FldGetTextLength(pCtlField)>0) // We can add a note since we have
> something
> {
> hText=FldGetTextHandle(pCtlField);
> FldSetTextHandle(pCtlField,NULL);
> pText=(CharPtr)MemHandleLock(hText);
> addNote(pText,ADD_NOTE_NOTE );//inserts note into database
> MemHandleUnlock(hText);
depending on the provenance of hText, you might need
MemHandleFree(hText);
> // FldFreeMemory( pCtlField );
> }
> FrmGotoForm(PalmLinkPatientNotesForm);
> handled=true;
> break;
> ==================
>
> Originally I did not have the line
> FldSetTextHandle(pCtlField,NULL);
> and adding the line:
> FldFreeMemory( pCtlField );
> would cause it to crash which is why it is commented out.
>
> In this example I only have one text field on the whole form. (so it is
the
> simplest case)
> Thanks,
> Jim
>
> --
> Our new email address is [EMAIL PROTECTED]
> .
> "Philip Sheard" <[EMAIL PROTECTED]> wrote in message
> news:40070@palm-dev-forum...
> >
> >
> > > I have a form where some editing occurs. When the user presses the OK
> > > button the values are collected off the screen and saved in a
database.
> > > Then a gotoForm is called and when this form comes up it crases in the
> > forms
> > > open event. In that event I have a variety of functions getting
called.
> > If
> > > I rearrange these functions It will crash in a different place.
>
> > >
> > > I am using global variables. Am I over running my stack? It seems to
> me
> > > that the functions are doing the correct things (because if I put the
> > order
> > > of execution differently the program does not crash in the same spot).
> I
> > am
> > > a little confused as to how the use of global variables affects my
stack
> > > size if any. Does it?
> >
> > The error lies in the form being closed. Have you freed all the text
> > handles?
> >
> >
> >
>
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/