you could use:

while (DmNumRecord(gTempDB))
    DmRemoveRecord(gTempDB, 0);

i looked up the implementation of DmNumRecord, and as i expected, it's a
one-line accessor to a stored data member.

the only drawbacks are:
#1 - if you ever use DmDeleteRecord in that temp database, you'll need to
change the logic (but your code already had that caveat, and since it's a
temp database you probably will never use DmDeleteRecord anyway).
#2 - if there are 1 or more private records at the end of the temp database
and private records are being hidden, they will not be deleted because
DmNumRecords will not include them.  (however, as long as the last record in
the database is NOT private, then all record (incl. private ones) will be
removed).


-----Original Message-----
From: Hardy Macia <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Saturday, March 20, 1999 3:22 PM
Subject: Removing all Records in DB


>I'm doing the following to remove all of the records in my temp database
>
>while (0==DmRemoveRecord(gTempDB,0));
>
>It works fine on Palm OS 3.0, but on Palm OS 2.0 I get an error:
>
>DataMgr.c, Line: 6178, Index out of range.
>
>How should I be removing all of the records in a database?


Reply via email to