Another option that I've used successfully is instead of deleting the
database inside of the loop, store the database ID in a list, and delete the
databases in the list after the find loop.

Alan Dorfmeyer

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Scott
> Johnson
> Sent: Friday, March 15, 2002 12:11 PM
> To: Palm Developer Forum
> Subject: RE: Odd DmGetNextDatabaseByTypeCreator behavior
>
>
> > From: Mark A. Peters [mailto:[EMAIL PROTECTED]]
> > I wanted to delete all databases with a given creatorID,
> > so I wrote this code:
> >    while (errNone == DmGetNextDatabaseByTypeCreator
> (newSearch, ...)) {
> >        newSearch = false;
> > Am I just having a bad day and can't see an obvious problem
> with my code?
>
> It may not be so obvious, but here it is: when you delete a
> database within
> a DmGNDBTC loop, you mess up the loop itself because you are
> changing the
> list of installed DB's.  You end up not iterating over all the DB's.
>
> To fix this, keep newSearch = true for every iteration.
>
> -slj-
>
>
> --
> 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/

Reply via email to