Orasanu Iuliana wrote:
i have a problem with the lat param for this function the
Boolean that means save or not saved.

Here's what that parameter means:

On the Palm, there are two databases.  There is "Saved Preferences"
and there is "Unsaved Preferences".  Beside the name, there is only
one difference between them.  The difference is, "Saved Preferences"
has the backup bit set, and "Unsaved Preferences" does not have
the backup bit set.

That means when you hotsync, "Saved Preferences" is backed up, but
"Unsaved Preferences" is not.

The last parameter to PrefGetAppPreferences() simply tells the
function which database to use.  If the Boolean value is true, it
uses "Saved Preferences"; otherwise, it uses "Unsaved Preferences".

So, you pass true if you want the data to be backed up at hotsync
time, and false if you don't want the data to be saved.  I usually
put temporary crud in unsaved preferences.  For instance, one app
I've done has a history of all the items the user has viewed.  Since
it's OK to lose that if the device is reset, I put that as unsaved.
But, the user also has regular preferences (that they can change
from a preferences window), and I put that in saved preferences
so that it will survive even if they have to do a hard reset, etc.

who do i save the curent preferences, more exactly? if the user makes changes to the current application i
whant them saved, when the user makes that change.

PrefGetAppPreferences() just reads a resource from either Saved Preferences or Unsaved Preferences. If you change the data and you want to write it back out (so that it's there the next time your application runs), then you need to call PrefSetAppPreferences(). Of course, you need to pass the same value for the last parameter ("saved") to both functions: if you don't, then you will be writing to one database and reading from another, which won't work out very well.

  - Logan

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

Reply via email to