BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using FindNearest to search a table

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (Desktop)
View previous topic :: View next topic  
Author Message
Jim Zirbes
Guest





PostPosted: Thu Jan 08, 2004 3:17 pm    Post subject: Using FindNearest to search a table Reply with 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?

Jim Zirbes
[email]jzirbes (AT) opsi (DOT) com[/email]


Back to top
Dwayne
Guest





PostPosted: Sun Jan 18, 2004 7:18 pm    Post subject: Re: Using FindNearest to search a table Reply with quote



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()<CoolB=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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (Desktop) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.