This is more of a FYI than anything else.  Yesterday I got a "Bad field
selection" error from a debug ROM after entering a string with the system
keyboard dialog.  Today I found out why, and I think it may be helpful to
have this info archived 'in' the Palm developers list.

Basically my problem was that after I tapped the 'done' button on the
virtual keyboard a form update event was sent and handled *before* the code
following the SysKeyBoardDialog call was executed.  So, basically, if you
have code like the following in an event handler:

  case frmUpdateEvent :
    bar();
    break;

//...

  case fldEnterEvent :
    switch (FrmGetActiveFormID()) {

      case MG08TreatmAdvForm :
        SysKeyboardDialog(kbdDefault);
        foo();
        break;

// ...


Then *immediately* after the keyboard dialog returns the function bar() will
be called, and after that the function foo() will be called.  In my case I
was modifying the contents of the field that the system key board dialog
returned due to how I was handling the form update event, and protecting
those contents in the code sequence following immediately after the call to
the SysKeyboardDialog(kbdDefault).

I think the event sequence as described above also occurs when the system
date picker is called with the SelectDay(...) function, and that may explain
why some of our programs crash on a physical Palm device after we select a
day with the standard PalmOS date picker.

Hope this story helps someone out there!



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to