Is the "{" that I added below (look for lines
not beginning with the e-mail quote character '>')
actually missing in your code, or was there a
cut-and-paste error when you posted the code to
the list?
--
-Richard M. Hartman
[EMAIL PROTECTED]
186,000 mi./sec ... not just a good idea, it's the LAW!
> -----Original Message-----
> From: Stuart Norton [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 14, 1999 5:33 AM
> To: [EMAIL PROTECTED]
> Subject: RE: MemoryMgrNew Crash
>
>
> Ok. I'll use a handle. Here's the whole function anyway (for
> the whole Palm
> Developer Community to laugh at!...Remember I'm still learning)
>
> static Err WriteFldText(Word FldID, CharPtr newtext)
> {
> FieldPtr fld;
> CharPtr disptext=MemPtrNew(16); //changed from sizeof thing!
> fld=GetObjectPtr(FldID);
>
> if(fld==NULL)
> { //checks
> FrmCustomAlert(CustomAlert,"","FldWrite:Not a
> valid field for this
> form",""); //gets Field Pointer
> return (1);
> }
> else
>
{ /* this brace was missing from the posted code */
>
> FrmCustomAlert(CustomAlert,"","Writing Field...","");
> FldSetMaxChars(fld, 16);
> FldSetTextPtr(fld, newtext);
> FrmCustomAlert(CustomAlert,"",newtext,"");
> StrCopy(disptext,newtext);
> FldDrawField(fld);
> FldFreeMemory(fld);
> }
> if (disptext) MemPtrFree(disptext);
> return (0);
> }
>
> It definitely was this crashing the program, as I couldn't
> crash it when I
> commented it's calls out. I'll rewrite it and then show you.
> I may be a
> while!
>