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 Message -----
From: "Low Pui Kuen" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Monday, January 28, 2002 16:13
Subject: Problem with removing all the records at a time


> 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?
>
> file://In the SetupMod.c
> UInt16 i = 0;
>   .
>   .
>   .
> case cmdModDel :
>
> for(i = 0; i < CountRecord(); i++)
>     RemoveModule(i);
> /////////////////////////////////
>
>
>
> file://In the NPET_database.c
> void RemoveModule(UInt16 index)
> {
>
> Err err = OpenDB();
>    if (err)
> return err;
>
> return DmRemoveRecord(dbPtr,index);
> }
> /////////////////////////////////////
>
>
> Thanks in advance.
>
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
>
>
> --
> 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/

Reply via email to