I have a database that is synched down from the desktop.
My database record structure looks something like this:
typedef struct{
UInt index
CharPtr Answer1;
CharPtr Date1;
CharPtr Time1;
CharPtr Answer2;
CharPtr Date2;
CharPtr Time2;
}records;
I have about 100 records, with predefined values initialised at the desktop,
before synching down to the Palm.
In the Palm, when I save the, say 5th record, the initial values of the 6th
and 7th records are being replaced by some other information that does not
make sense. I know this is a memory problem.
The initial values of each element are as follows:
UInt index: some unique number that I can identify
UInt CurrSlot: 1
CharPtr Answer1: FF
CharPtr Date1: FF
CharPtr Time1: FF
CharPtr Answer2: FF
CharPtr Date2: FF
CharPtr Time2: FF
When I save the actual values that I want in the Palm, some example values
looks like this:
Answer1: IV
Date1: 23/06/01
Time1: 11:00
I know that with this new values, the record memory size has enlarged. So I
have resized my 5th record using DmResizeRecord to get a bigger memory to
store the changes. But it's because of this that the adjacent records'
initial values gets replaced with non-sensical info. My desktop conduit
detects the presense of the initial values to determine whether each entry
is a valid entry. With my problem now, my conduit can't relate to the junk
values.
It seems like it's because of the way the PalmOS database records are
arranged in a linear array fashion, with each record having a fixed size,
that is causing this problem.
What I need is to be able to save the strings of the Answer#, Date# and
Time# of each record, but be able to keep all of the initial values of each
record intact.
Can anybody help??
Thanx in advance
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/