Combee on Palm OS

Thursday, 6 May 2004  2:14 PM

Here at PalmSource, we just found a bug in code I wrote for the CodeWarrior for Palm OS application wizards.  The default application generated by these wizards has a large field and a button that lets you clear the text.  That button ends up calling:

FldDelete(fldP, 0, 0xFFFF);

to clear out all of the text.  Well, that FldDelete call isn't valid on Palm OS Cobalt.  Instead, you need to write:

FldDelete(fldP, 0, FldGetTextLength(fldP));

As far as I can tell, using 0xFFFF to delete the entire field was never a supported construct, but I didn't notice this bug during my own testing, since Palm OS 5 and earlier silently fixed this error.  If you want to update your template files, just do a search-and-replace in the "Templates/Palm_OS_Templates/app-c-source.mtl" file, replacing the bad line with the corrected one.