|
|
|
|
|
|
|
|
|
|
|
|
|
|
Setting application preferences (continued)
Another addition for OS 2 is that you can delete the preferences for your application by calling PrefSetAppPreferences with a length of zero.
Palm OS version 3
The Palm III came with even more improvements and changes. Fortunately, the only change to the system preferences structure were changing the names of the sound levels, and adding new preferences to the end of the structure.
Look at http://www.component-net.com/pp-extras/prefs3.html to see shows the system preferences structure for Palm OS 3.
Handling rocketship preferences Ok, so how does all this work? Look at Rocketship at http://www.component-net.com/pp-extras/prefs4.html and you'll see I've added two routines; ReadAppPreferences to load the preferences when Rocketship starts, and SaveAppPreferences to save them as the application exits.
To determine which APIs should be used, another routine (GetOSVersion) returns the Palm OS version number. The load and store routines check which OS is running and use the appropriate routines.
For this program, there's not much being stored, and that which is being stored is placed in the saved preferences, so why bother checking which OS is running? Why not just use the OS 1 APIs or the OS 2 APIs?
If I use the OS 2 APIs, then the program won't run on Pilot 1000s and 5000s. There's no reason to needlessly exclude those machines. And if I just use the OS 2 APIs, there's a risk that a future machine would support the newer APIs and not the older ones. If that happens, then Rocketship would crash on it. Of course, some future machine may not support either API, but the newer APIs are supported on the Palm III so it's likely they'll be supported longer.
Additionally, I wanted to show you how to determine what OS you're running under. If you're reading system preferences, you need to know what preferences are there, and you need to deal with the structure changes between OS 1 and OS 2.
Next month Next month we'll add a few new things to Rocketship, making it into a playable game. It'll still be simplistic, but be more entertaining than it currently is.
Alan Weiner has many preferences - primarily chocolate. His email address is alan@ajw.com.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
NO HASSLE PHOTO PRINTING, SHARING, AND STORAGE -- AS LOW AS $2.54 PER MONTH
Discover an easier way to share, print and manage your photos online! Get your own online photo album site for sharing photos, as well as easy-to-use editing tools to make sure your photos look their very best. You can even order high quality prints directly from your album -- and have them delivered right to your door!
Best of all, you can also get login-free photo sharing at your personal domain name (if you have one), so your friends and family don't have to hassle with signing up or logging in just to view your pictures. It's the perfect solution for sharing, printing and storing all your favorite images!
And it's only from The Duck! Tap here to get started. |
|
|
|
|
|
|
|
|
|
|
|