Hi.
You can reverse the for loop and remove from the last one (DmNumRecords-1) to
0.
Max
--- Low Pui Kuen [EMAIL PROTECTED] wrote:
Hi,
I want my function to perform a deletion of all records at a time but
instead it only deletes half of the records.
Anybody has experienced this before?
At 10:13 PM 1/28/2002 +0800, Low Pui Kuen wrote:
Hi,
I want my function to perform a deletion of all records at a time but
instead it only deletes half of the records.
Anybody has experienced this before?
//In the SetupMod.c
UInt16 i = 0;
.
.
.
case cmdModDel :
for(i = 0; i
Oops, I meant records numbers are maintained 0 to (nRecords - 1)
-Ken
--
From: Low Pui Kuen[SMTP:[EMAIL PROTECTED]]
Reply To: Palm Developer Forum
Sent: Monday, January 28, 2002 9:13 AM
To: Palm Developer Forum
Subject: Problem with removing all the
After deletion of a record, the record index's are reassigned. They are
always maintained 1 - nRecords. Try always passing index=0 to
DmRemoveRecord() or delete the entire database and recreate it.
-Ken
--
From: Low Pui Kuen[SMTP:[EMAIL PROTECTED]]
Reply To: Palm
In the for CountRecord() will be invoked in every iteration. And when
i became N/2 you had removed n/2 records and CountRecord will return
n/2. Then the for statement will exit.
You should write somthing like:
UInt16 n = CountRecord();
for(i = 0; i n; i++)
RemoveModule(i);
- Original
Actually using for...next for this kind of task has never been a good idea.
The way to do it is:
while(CountRecord()0)
RemoveModule(0);
- bobby
-Original Message-
You should write somthing like:
UInt16 n = CountRecord();
for(i = 0; i n; i++)
RemoveModule(i);
--
For