Okay, this is odd.
I'm trying to get a preferences structure set up so that it stores certain
application data. However, I can't get it working! I'm completely at a
loss. It also seems that my global variables can remember data between
executions. ??
Here are the functions I'm using. Am I setting this up correctly?
// ViewSplash is a global variable
static void loadPrefs()
{
preferenceType prefs;
Word prefsSize;
// Read the preferences / saved-state information
prefsSize = sizeof(preferenceType);
if(PrefGetAppPreferences(CREATOR, PREF_ID, &prefs, &prefsSize, true) ==
PREFS_VERSION_NUM)
ViewSplash = prefs.viewSplash;
else
ViewSplash = 1;
}
// ViewSplash is a global variable
static void savePrefs()
{
preferenceType prefs;
// Write the preferences / saved-state information
prefs.viewSplash = ViewSplash;
// Write the state information
PrefSetAppPreferences(CREATOR, PREF_ID, PREFS_VERSION_NUM, &prefs,
sizeof(AppPreferenceType), true);
}
+++++++++++++
Timothy D. Astle
Embedded Systems Programmer
ALT Group Inc.
+++++++++++++
"People who can smile when things go wrong has thought of someone else to
blame it on."
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/