A couple of things you could do...
1) Use findPosNear but remove all spaces before your search (and all spaces in the list). In other words, the list has "LlwynCastan" and "LlwynDerwRoad", and when the user enters "Llwyn Castan" you remove the spaces and search for a match for "LlwynCastan".
2) Don't use findPosNear but search the list by hand (e.g.: a 'repeat' loop) and use the string function 'starts' to see if the destination string starts with the one you're looking for. This should honor all spaces (meaning: spaces count).
- Tab
At 03:37 PM 10/13/02, Paul Steven wrote:
Hi there I am creating an application that allows the user to enter a street name and for the application to display the relevant map.Basically I have a list of all the street names sorted in alphabetical order and I am using "findPosNear" to find the nearest match. Unfortunately this doesnt seem to work perfectly when there are spaces in the street name. For example when I type in "Llwyn Castan" I am given "Llwyn Derw Road" as the closest match instead of "Llwyn Castan". I guess it is due to the spaces in the words and the way findPosNear works. Anyone got a fix for this or a better algorithm for doing a word match like this? Another weird thing is that on the Mac, I am getting slightly different results e.g when I type in "Llwyn Castan" I am given "Llwyn Drysgol" Again, any ideas or help much appreciated. Thanks Paul
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/lingo-l.cgi To post messages to the list, email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping with programming Lingo. Thanks!]
