Hi!
I have developing an application (off & on) for a while that searched
small PDBs. The key fields of the DB are text entries and the DBs are
alphabetically sorted. My goal is to replicate the functionality that
we all know and love.... namely : as the user enters successive
characters of the target string,the "list from which to select" displays
the available choices from the DB. (So the user enters a "b" and the
list scrolls to "Banana" (as this is the FIRST element in the list that
begins with a "B"). Then the user enters an "e" to make the target
string "be" and the list scrolls to "beet" etc. etc.)
All this worked great when I was using a linear "brute force" search,
but then my DB got BIG! So I switched to a binary search... which
works great... but (as you may have surmised) a binary search (in
this particular example doesn't *quite* work since it may put you
way PAST the intended target! For example, when the user enters a
"b" the binary search way bounce around and end up matching the "b"
with "bird" instead of the FIRST entry ("Banana") (I am only
searching for a match on the first character since that's all I have).
I have a sickening feeling that I am just being an idiot....
Please prove me right! ;-)
Thanks!
Dan
--
For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/