> From: nim bha
>
> I am deep inside my function calls and wish to
> terminate my application.
>
> Adding appStopEvent in Event Queue does not stop
> application [snip] till it complete the whole
> code in all funcion calls.
>

That's because, if you wrote your app like a typical Palm app, most all of
your code is being executed inside a while loop in your AppEventLoop
function, and that loop terminates when it sees an appStopEvent event.  The
closest I can think of to "immediately" terminating your app is to call
SysUIAppSwitch to switch to another app.  However, the docs say not to use
this to start the Launcher because another app may have replaced the default
Launcher.  They say that you should enqueue a launchChr instead.  I don't
know if that will be sufficiently "immediate" for you.

Another way you could exit without executing too much more code would be to
use a global Boolean, gTimeToQuit, and post an appStopEvent and set it true
when you want to exit, and test for it at the start of each function and
break out of each function (except maybe AppStop which you want to execute)
immediately if it is true.  Of course, this doesn't immediately stop your
app, but it does prevent it from executing any more code that might be
causing problems when you want to exit.

Maybe someone else has a better idea?


-- 
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