On Tue, Jun 11, 2002 at 10:25:13AM -0400, Chris DiPierro wrote:
> Presumably, return errNone if there's no error, otherwise return as correct
> an error as possible. It may be true that nothing's listening to your
> return, but may as well try to be as verbose as possible, right?

We had this back in October, in the context of unrecognized launch
codes, at which time I wrote [1]:

| What should the return value of PilotMain be?  Here's what the
| documentation has to say about it:
| 
| Reference p995[1015] discussion of PilotMain:
| 
|         Return errNone [0] if your application processed the launch code
|         successfully, or an appropriate error code if there was a problem.
|         When another application invokes your application using
|         SysAppLaunch, this value is returned to the caller.
| 
| Companion p21[37]:
| 
|         If an application can't handle a launch code, it exits without
|         failure.
|
| In practice, everyone just returns 0 all the time.  (Occasionally people
| really do return error codes (I don't think the Launcher does anything
| with them (?)) when databases can't be opened and such, but certainly they
| all return 0 for launch codes that aren't in their big case statement.)
| 
| And in fact it's a feature.  Applications silently saying "yeah ok" to
| unrecognized launch codes (instead of returning errors) is what allows
| you to define new launch codes without breaking old apps.

It still seems to me that either the Reference and Companion contradict
each other, or the note in the Companion is unclear.

Bob Ebert replied at the time:

| If the PilotMain of the newly launched app returns an error code, then
| the previous app is re-launched with sysAppLaunchCmdFailedNotify [sic],
| so that it knows the last launch failed.
|
| Of course, most apps ignore this launch code, so when they do
| UIAppShell then goes on to re-launch the same previous app with
| sysAppLaunchCmdNormalLaunch.
|
| The idea of always falling back to sysAppLaunchCmdNormalLaunch is pretty
| important, since almost every app supports that launch code, but it does
| tend to mask the (lack of) error recovery in most apps.

At the time I noted that sysAppLaunchCmdFailedAppNotify is not mentioned
in the Reference or Companion, and that is still the case.

    John

[1] Except that here I've changed the page numbers to apply to the
    documentation in the 5.0 SDK.  "A[B]" means the page is labeled A
    but you type B into Acrobat's "Go To Page" dialog.  Sheesh.

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

Reply via email to