Start at the last index and move to the first. for(i=totalNumber-1;i>=firstRecordNumber;i--)
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf > Of Edward > P. Ross > Sent: Tuesday, September 03, 2002 8:52 PM > To: Palm Developer Forum > Subject: Removing Multiple Records > > > I have a trivial problem but I need another set of eyes. Here's my > situation: > > I have a table that has a column of checkboxes and a text field, based > on whether the checkbox is checked I want to delete the > record so I want > to loop through the records, deleting each one that needs to > be deleted. > > This code deletes records but it varies from what should happen. My > question is what is the best way to do this? and Does using > DmRemoveRecord change the record numbers of the existing records? > > > for (i = firstRecordNumber; i < totalNumber; i++) { > recH = DmQueryRecord((gMyDB), (i)); > if (recH) { > recP = MemHandleLock(recH); > > if (recP->Completed == false) { > DmRemoveRecord(gMyDB, i); > } > } > } > > > Any help would be appreciated. > > Thanks, > Ed. > > > -- > For information on using the Palm Developer Forums, or to > unsubscribe, please see http://www.palmos.com/dev/support/forums/ > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
