<< Click to Display Table of Contents >> Navigation: Apollo VCL Components > Apollo VCL Component Reference > TApolloTable > TApolloTable Methods > Found |
Declaration
function Found: WordBool;
Description
Queries the result of the last index seek made on the current work area.
Return Value
True if the seek was successful and False if not. Note that Seek immediately returns the result of a seek. Found can be used after the fact to test the result of the last seek.
The result of Found may be compromised by a hidden relational seek (see SetRelation) unless it is called immediately following the call to Seek.
Delphi Example
// Found can be used when SoftSeek is True to determine whether the record found is a match or the result of finding a record after the requested key.
procedure Form1.Button1Click(Sender: TObject);
var
cRecStr: String;
begin
// Get SEEK value from user
sRecStr := SeekBox.Text;
if sRecStr = '' then
Exit;
sRecStr := UpperCase( sRecStr );
with ApTbl do
begin
SetSoftSeek( True );
if Seek( sRecStr ) then
begin
if Found then
ShowMessage( 'Exact or partial match!' )
else
ShowMessage( 'Soft seek - on record after' );
end
else
begin
ShowMessage( 'Key Not Found' );
SetSoftSeek( False );
end;
SetSoftSeek( False );
end;
See Also