Actually I found the documentation on DmFindSortPosition to be clear on this
point and I use the function successfully to find records, insert records,
etc. The docs makes a point of describing exactly the nature of the returned
value; it references an index value that is described as follow:

The position should be viewed as between the record returned and
the record before it. Note that the return value may be one greater
than the number of records.

I personally found that to be clear. 




> -----Original Message-----
> From: Danny Epstein [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, October 07, 1999 1:33 PM
> To:   [EMAIL PROTECTED]
> Subject:      Re: Bug in DmFindSortPosition [was Generating unique record
> IDs]
> 
> At 12:49 PM -0400 10/7/99, Thomas Ward wrote:
> 
>       What exactly is the "off-by-one bug"? Is it still there in the
> latest
>       versions of the OS? I tried looking in the archives and the
> knowledge
>       base, but couldn't find anything. I've been noticing some strange
> 
>       behavior using DmFindSortPosition, so I'd appreciate any information
> you
> 
>       have on it.
> 
> 
> It could be argued that the bug is in the documentation for
> DmFindSortPosition rather than in the routine. The docs say this routine
> can be used to find a record in a sorted database or to find where to
> insert a record. For the latter use, it works fine. For the former, it
> returns the record number of the record after the record found (if it was
> found). I have a wrapper function that "corrects" this "bug" (without
> assuming that the "bug" is still present). It's a bit long to post, so let
> me know if you want me to send it to you.
> 
> The above paragraph describes the situation in Palm OS 3.0; I don't know
> about more recent versions.
> 
> HTH,
> -
> Danny Epstein, Applied Thought Corporation
> Have friends with Palm organizers? Get BeamBooks!
> http://www.appliedthought.com/beambooks

Reply via email to