Hi Ai,
Looks like there is a wrong type of declaration in the function
> DmInsertionSort(dbP, (DmComparF *) &CompareRecords,sortOrder);
the function name is actually a pointer, but what you are doing here is
trying to
access the address of the function.
All you need to do is
> DmInsertionSort(dbP, (DmComparF *)CompareRecords,sortOrder);
remove the " & " symbol there.
Hope this helps.
Feel free to get back for any further clarifications.
Thanks
Arvind
Developers' Nation
You've got the questions; we've got the answers.
Visit Us At :http://www.devnation.net for Palm Developer Support
"Ai Lee Tang" <[EMAIL PROTECTED]> wrote in message
news:47863@palm-dev-forum...
>
> hi all,
>
>
> i having a problem on database sorting. I was applied this function to do
> sorting,
>
> DmInsertionSort(dbP, (DmComparF *) &CompareRecords,sortOrder);
>
> static Int CompareRecords (RecordPtr r1, RecordPtr r2,
> Int sortOrder, SortRecordInfoPtr info1, SortRecordInfoPtr info2,
> VoidHand appInfoH)
> {
> Int result;
> result = StrCompare(r1->name, r2->name);
> return result;
> }
>
>
> But i got Bus error. I noticed that r1 and r2 pointing to null record.
> Is it because i did not tell the system where are the r1 and r2.
>
> Do i have to pass in pointers to r1 and r2? How to do so? Where should i
> define r1 and r2?
>
> rgds,
> ailee
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/