My mom worked at USUHS and both my parents went to med school there.  What
are you currently studying there?

Use the Palm OS preferences.  Set up a structure that will store all the
default data

typedef struct {
    UInt8    gradeLevel;
    UInt8    rotation;
    char    name;
} AppPrefsType;

Then fill that with data throughout the program.


Here's how to store the preferences.
<<<CODE>>>
 char studentName[] = "Ben McIlwain";
 UInt8 studentRotation = 10;
 UInt8 studentGradeLevel = 4;
 AppPrefsType *aptPDefaults;
 MemHandle hAppPrefs;
 UInt16 sizeOfPrefs;

 sizeOfPrefs = StrLen(studentName) + 1 + sizeof(UInt8) + sizeof(UInt8);
 hAppPrefs = MemHandleNew(sizeOfPrefs);
 aptPDefaults = MemHandleLock(hAppPrefs);
 aptPDefaults->gradeLevel = studentGradeLevel;
 aptPDefaults->rotation = studentRotation;
 StrCopy(aptPDefaults->name, studentName);

 PrefSetAppPreferences (CREATOR_ID, 0x00, 0x01, aptPDefaults, sizeOfPrefs,
true);

<<<END>>>

And to read it:

<<<CODE>>>
    UInt16 gAppPrefsSize;



 // Read the saved preferences / saved-state information.
 AppPrefsType aptPDefaults;
 appPrefsSize = sizeof(AppPrefType);
 PrefGetAppPreferences(CREATOR_ID, 0x00, aptPDefaults, &gAppPrefsSize,
true);


 MemHandleUnlock(hAppPrefs);
<<<END>>>

Don't just copy and paste that code because I think I did some of it wrong.
Use it to give you an idea of what you want to do.  Implement those two
functions through.  The reason the above reading of preferences won't work
is because with the student's name being a variable length, it's hard to
know how much room we need to store it into.  Let me know when you get it
started and I'll help all I can through the reading part.

Good luck!


"Ben McIlwain" <[EMAIL PROTECTED]> wrote in message
news:54427@palm-dev-forum...
>
>   Hey all, I'm working on a Palm OS version of Clinical Web Log, which
> medical students use across the nation to keep records of their patient
> experience.  The online version can be found at
> http://cweblog.usuhs.mil  The Palm OS program has largely been finished
> and allows medical students to enter the notes on their Palm device and
> have it synched with the server each time they Hot Sync.  Not that Avant
>
> Go is used at some point in this process.  The only problem we have now
> is that medical students are complaining that for each patient they have
>
> to re-enter grade level, name, rotation, etc, stuff which doesn't change
>
> frequently at all, if ever.  Seeing as how they well may be doing
> hundreds of these a week, it's a concern.  So my question is: how do I
> set up this database program so that, for each new submission, the
> fields default to what was entered the previous time, i.e. a sort of
> "Cookie" on Palm OS devices?  Thanks so much for all of the help, you'll
>
> be saving hundreds and hundreds of manhours of worthwhile medical
> students!
>
> Ben McIlwain
>
>
>
>
>



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

Reply via email to