>>Gremlins uncovered that in a particular alert in my application, tapping
>>on the text of the message on a 3.5 debug ROM produces a "Invalid
>>insertion point position" fatal error. No error occurs on release
>>ROMs. This alert is relatively long (taking up about 2/3 of the
>>screen), but this is not the cause of the error as other longer alerts
>>have no problems. A single substitution is made using FrmCustomAlert;
>>the error occurs regardless of the length of the parameter text. What
>>could I be doing to cause this? Is it simply a case of the debug ROM
>>being too paranoid and checking the insertion point of a non-editable
>>field?
>Ken Krugler wrote:
> > It would be great if you could send me the app, with a reproducible
> > test case. We've run into (and fixed) other problems with alerts and
> > long messages, but this is a new one to me.
> >
> > Another option, if you're handy with the debugger, is to dump out the
> > contents of the field being checked, as well as a stack crawl. That
> > might provide enough information to find the source of the problem.
> >
>
>I'm not handy enough with the debugger to figure out what's going on
>deep within FrmCustomAlert. I've attached the app;
Thanks for the app & debugging steps. The problem is that your alert
message has a linefeed at the very end. The trailing linefeed is
skipped when calculating the height of the message text, which is
then used to resize the text field box in the alert. Unfortunately
the insertion point is at the end of the text, so when you tap on the
text, the field code correctly complains that the insertion point
visible flag is set the field attributes, but the insertion point is
on line 7 (the eighth line, since line counts are zero-based) which
isn't visible, being below the bottom of the text field bounding
rectangle.
So the fix for you is to remove any trailing linefeeds from your
alert messages. The fix for Palm OS is to trim off trailing linefeeds
before creating the text field used in alerts. I'll put that on the
list for future fixes.
-- Ken
Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/