On Sat, Nov 16, 2002 at 10:08:03AM -0600, Michael Harrison wrote:
> I've recently had to divide my first palm app into two sections and
> was suprised to discover that when I initiate a find (which my app
> supports), my application would crash during a call to a function that
> wasn't in the default section.

You really should not have been surprised :-).  If you know about launch
codes, then you know that many of them do not get global variables.
This really must be one of the top three "Palm OS quirks that aspiring
Palm OS programmers learn very quickly".

And it's equally well known that access to code sections other than the
main one requires global variables.  See for example "Responding to
Other Launch Codes" in the Application Startup and Stop chapter of the
Companion, and also in particular

http://prc-tools.sf.net/cgi-bin/info/multiple+code+resources+and+global+data

> If Yes, did you find a solution other than merely making sure that
> your search function only called routines in the default segment?

That is the standard solution.  The other solution is "manually cons up
and initialise global variables yourself for launch codes that don't
give you globals" which isn't a lot of fun, is fragile, and, if you
believe the original Palm OS design decisions, will slow down Find and
such unacceptably in general.

    John

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

Reply via email to