This is normally handled by setting application preferences for each
application.
Are you using CodeWarrior? Starter.c and Starter.cpp both contain the
outline of how you do this:
typedef struct
{
// put your variables here
UInt8 replaceme;
} StarterPreferenceType;
...
#define appPrefID 0x00
#define appPrefVersionNum 0x01
...
static Err AppStart(void)
{
StarterPreferenceType prefs;
UInt16 prefsSize;
// Read the saved preferences / saved-state information.
prefsSize = sizeof(StarterPreferenceType);
if (PrefGetAppPreferences(appFileCreator, appPrefID, &prefs, &prefsSize,
true) !=
noPreferenceFound)
{
// save prefs info in some global vars
}
return errNone;
}
static void AppStop(void)
{
StarterPreferenceType prefs;
// Write the saved preferences / saved-state information.
PrefSetAppPreferences (appFileCreator, appPrefID, appPrefVersionNum,
&prefs, sizeof (prefs), true);
// Close all the open forms.
FrmCloseAllForms ();
}
----- Original Message -----
From: "SCMIT Info" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Monday, December 11, 2000 11:11 AM
Subject: Re: Common Variable
> Thank you Richard, but, for example, what if I want that when the
> application is closed it could be opened at the same point as it was
closed,
> like the Memo app. Where is saved all this information? I mean,
> attributes, variables, and others. I ask this because with this same
logic
> maybe it is possible to save that common variable that I ask before.
>
> Thank you,
> Farzin
>
>
> ----- Original Message -----
> From: "Richard Burmeister" <[EMAIL PROTECTED]>
> To: "Palm Developer Forum" <[EMAIL PROTECTED]>
> Sent: Monday, December 11, 2000 11:54 AM
> Subject: Re: Common Variable
>
>
> > From: "SCMIT Info" <[EMAIL PROTECTED]>
> >
> > > How may I create a common variable so this two
> > > different programs could use it?
> >
> > One app can create a database, write the value of your variable to it,
> then
> > close the db. The other app can open that database, read the value,
> change
> > it, then close it. The db should use the creator id of one of the two
> apps
> > so it will be deleted when that app is deleted.
> >
> >
> >
> >
> > --
> > For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/tech/support/forums/
> >
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/