SeekBin

<< Click to Display Table of Contents >>

Navigation:  Apollo VCL Components > Apollo VCL Component Reference > TApolloTable > TApolloTable Methods >

SeekBin

Declaration

function SeekBin( sKeyValue: String; iLength: Integer ): WordBool;

Description

Searches the current order for a supplied key. The key may contain binary zeroes.

 

Some xBase programmers become very innovative in inventing data storage algorithms that bypass the standard xBase character fields. These data storage methods usually involve some type of binary representation to conserve space (e.g., representing time in two bytes - the first byte hours and the second minutes). If indexes are constructed on these fields, the search value cannot be passed as a string because the value may contain a binary zero - which normally signifies the end of a string.

Parameters

sKeyValue: The binary value to search for. The search key value may be a partial key (if SetExact is not True).

iLength: The length of the search key.

Return Value

True if the key was found and False if not. If the return is False, Found will be False and Eof will be True.

 

For various conditions that may affect the return value, see Seek.

Delphi Example

// Seek binary key on TIME >= 1AM

sKeyString := #0 + #1 + #0 + #0;

ApolloEnv1.SetSoftSeek( True );

if not ApTbl.SeekBin( sKeyString, 4 ) then

begin

 ShowMessage( 'Key not found' ); 

 ApolloEnv1.SetSoftSeek( False ); 

 Exit; 

end;

See Also

Descend, EOFAction, Found, Seek, SetExact, SetSoftSeek