Hi,

I'm sorting a database (using either DmQuickSort or DmInsertionSort) but
getting a problem - if the last database entry is moved up the database
in the sort then it is not replaced... 

e.g.
dcba -is sorted to- abca 

Anyone had a similar problem or have any idea why it is doing this? I'm
using Falch.net as the IDE.

Thanks.

Simon

----

Code:

DmQuickSort(rec->table->db, (DmComparF *)CompareByName, 0);

... SortFunction:

static Int16 CompareByName(void *rec1, void *rec2, Int16
other,SortRecordInfoPtr rec1SortInfo, SortRecordInfoPtr rec2SortInfo,
MemHandle appInfoH)
{
        UInt16 matches;
        // The names are stored first in the records, so we can simply
use StrCompare:
        return StrCompare((Char *) rec1, (Char *) rec2);
        
}

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

Reply via email to