At 10:23 AM -0800 3/31/99, Jason Dawes wrote:
>I did this as an exercise this morning - is there anything we should know
>about DmQuickSort or the compare routines that isn't straight forward? I
>am getting an index out of bounds error and assumed that something akin to
>the broken SysBinarySort problem is causing it.
The only weird thing is that DmFindSortPosition tells you where to insert
the new record in a set of existing records. If there are equal keys, it
returns the index that is one greater than the last equal key (that is,
inserts at the end of equal keys.)
As a result, if you want to use it to search for a record given a key,
you've got to subtract one from the resulting index then check that record.
If your database can have multiple equal keys, you have to keep
backtracking until you get a non-matching record.
I'm pretty sure that whole thing is discussed in the "Palm Programming"
book by Rhodes and McKeehan from O'Reilly.
If that's not your problem, how about replying with a more detailed
description of what you're doing and how the problem comes up?
--Bob