 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jim Zirbes Guest
|
Posted: Thu Jan 08, 2004 3:17 pm Post subject: Using FindNearest to search a table |
|
|
I am using the function FindNeares to search a table by using the text typed
into a TEdit field and it works fine. However, I would like to be able to
detect when the function call can no longer find a match as I am typing in
text and the FindNearest doesn't return anything. Is there a way to do this?
Jim Zirbes
[email]jzirbes (AT) opsi (DOT) com[/email]
|
|
| Back to top |
|
 |
Dwayne Guest
|
Posted: Sun Jan 18, 2004 7:18 pm Post subject: Re: Using FindNearest to search a table |
|
|
| Quote: | I am using the function FindNeares to search a table by using the text
typed
into a TEdit field and it works fine. However, I would like to be able to
detect when the function call can no longer find a match as I am typing in
text and the FindNearest doesn't return anything. Is there a way to do
this? |
Do a string compare with your AnsiString and your Index Field, and
as soon as the compare does not match, SetFocus to another field, Pop up a
Window with Warning, or whatever you would like.
My suggestion would be to "Build" your Index as you go. I prefer
this method, because it allows for a lot of different errors.
example of Right Padded Index:
Edit1 Your_Info.
AnsiString B
IndexField char 8.
12345678
123
456
876
ABD
B=Your_Info.
do a while statement.
while(B.Length()< B=B+" ";
GotoNearest().
check and see if B is equal to your Table data, if not
pop your window. If so, loop back to your Edit1 input.
Dwayne
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|