I think I've somewhat worked thinks out in relation to records. Basically I
didn't quite understand the DmFindSortPosition() routine very well!
I still have one doubt though - how to compare something typed into a
field(i.e. not in a record) to the DB records to find a match. One of the
Palm tutorials suggests that I should build a record in dynamic memory for
this purpose. In other words: create a record in dynamic memory to hold the
stuff typed into the field and then compare this record with all the records
in the DB till a match is found. What I don't understand is:
1. How can I create a 'record' in dynamic memory!!
2. How exactly can I make the DmFindSortPosition/DmComparF
combination compare a dynamic record(whatever that is) to the DB records?
Thanks for any help. Sorry for the badgering!
Akshay
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Akshay
Shende
Sent: Monday, May 01, 2000 9:49 PM
To: Palm Developer Forum
Subject: RE: Keeping track of records
Thanks a lot for getting back to me Peter!
I think I'm getting closer to understanding records, so let me run this
last one by you ( and anyone else who can help! ) just to make sure I'm not
on a wild-goose chase:
So, supposing I have a 5 records database, and have stored a "Last Name" in
each; this data("Last Names" and the record indices) is stored in a struct
and loaded into preferences using PrefSetAppPreferences().
In this case, would the following pseudo-code be accuate - my objective
being to start the application afresh and find some specific person's "Last
Name":
1. Obtain a CharPtr to the stuff someone has just typed into a "search"
field.
2. Use DmGetRecord() to run through each of the 5 records, comparing
the stuff
typed into the "search" field with the stuff stored in the record. Each
time I call DmGetRecord() I would pass the in appropriate record index
that has been stored at the time I had created the records.
3. Get out of the loop when there is a match.
Really appreciate help, and big thanks for bearing with the novices!!
regards,
Akshay Shende
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Peter
Epstein
Sent: Monday, May 01, 2000 6:53 PM
To: Palm Developer Forum
Subject: Re: Keeping track of records
In general, Palm applications should save their state so that when the user
switches to a different app and then comes back, the state is pretty much as
it was when they left. The most common way to do this is to store the
necessary state information in the preferences. The tutorial that comes with
the SDK goes through this, so you can see how it's done. Of course, each
application is different, and you need to figure out a good representation
for this state which doesn't use too much memory.
--
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/