--- "Edward P. Ross" <[EMAIL PROTECTED]> wrote:
> What I am trying to do is cycle through records and duplicate 
> them, changing a date field.
> ...
> What happens in dupAddToDatabase, is that it uses a compare 
> function to find the insertion point in the database to add 
> the record to.  What happens when this function gets run, the 
> first record that matched the criteria is copied over and over 
> again instead of "looping" through the records.
> 

In general, it is a bad idea to try to insert records into a database
(or list, whatever) while you are interating over those records.  If
you must insert while iterating, make sure you are inserting after the
last record that you interate over.

When you insert a record into a Palm OS database, the records below it
are moved down. (i.e., record number 3 becomes record 4, 4 becomes 5,
etc.)  So, if you inserted your first new record above the first record
you located, after inserting the new record, the record you just looked
at becomes the next record that you look at.


__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to