Sorry for being curious.

Can I ask you how 'dict' in 'Dict' is defined,
and are the strings (if they are) really null-terminated ?
This might help to 'sort it out'.

But before that try without CALLBACK_... macros.

Michael


-----Original Message-----
From: Sean L. Gilley [mailto:[EMAIL PROTECTED]]
Sent: Monday, 3 December 2001 4:43 AM
To: Palm Developer Forum
Subject: Sort gives a "Chunk Not Locked" error.



I'm trying to sort a rather large database -- about 85,000 records.

When I call the sort routine, I get a "Chunk not locked" message.a

Below are the two routines.  Pretty simple.  But as soon as I get
to the line calling the sort function, I get the error.  I've tried
both Quick and Insertion sorts with the same problem.

SortRecords()   
{               
        DmOpenRef *gDB;
                
        CALLBACK_PROLOGUE;
                
        gDB = DmOpenDatabaseByTypeCreator('Dic', 'SGSI', dmModeReadWrite);
        DmQuickSort(gDB, (DmComparF *) DictCompareRecords, 0);
        DmCloseDatabase(gDB);
                
        CALLBACK_EPILOGUE
}       

UInt DictCompareRecords(Dict *elem1, Dict *elem2, Int i, SortRecordInfoPtr
s1, SortRecordInfoPtr s2, VoidHand appInfoH)
{           
        int ret;             
               
        CALLBACK_PROLOGUE;
        ret = StrCaselessCompare(elem1->dict, elem2->dict);
        CALLBACK_EPILOGUE               
        return ret;
}               

Any ideas?

Thanks,

Sean.

---
Sean L. Gilley
[EMAIL PROTECTED]
http://www.desert-penguin.com

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

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

Reply via email to