Find

In this section, we discuss the Find feature of the Palm OS. First, we give you an overview of Find, the UI, and its intended goals. Second, we walk through the entire Find process from beginning to end. Third, we implement Find in our sample application and discuss important aspects of the code.

Overview of Find

The Palm OS UI supports a global Find—a user can find all the instances of a string in all applications. The operating system doesn’t do the work, however. Instead, it orders each application, in turn, to search through its own databases and return the results.

There is much to be said for this approach. The most obvious rationale is that the operating system has no idea what’s inside the records of a database: strings, numbers, or other data. Therefore, it’s in no position to know what’s a reasonable return result and what’s nonsense. Indeed, the application is uniquely positioned to interpret the Find request and determine the display of the found information to the user.

Find requests are sent from the OS by calling the application’s PilotMain (see Section 5.5) with a specific launch code—sysAppLaunchCmdFind —along with parameters having to do with interpreting the Find.

The objectives of Find

Speed on the handheld is essential, so Find is intended to be a quick process. Here are some of the things the OS does to ensure this:

Does not create global variables

An application’s global variables are not created when it receives the sysAppLaunchCmdFind launch code. Creating, ...

Get Palm OS Programming, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.