SetQueryBit

<< Click to Display Table of Contents >>

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

SetQueryBit

Declaration

procedure SetQueryBit( lRecNum : LongInt; bValue : WordBool );

Description

Sets a bit (on or off) in a query bitmap for the specified record number. If the bitmap does not exist (i.e., Query has not been called or Query has set a non-optimized filter), the bitmap will be created.

image\tip.gif SetQueryBit should NOT be used against a partially optimized bitmap.

If combining QueryBit settings with another query expression, execute Query FIRST, and then set your bits in the existing bitmap.

Parameters

lRecNum: The record number of the bit that is being set. It must be > 0 and <= RecCount.

Return Value

TRUE if the bit is set and FALSE if not.

Delphi Example

// Filters out every other record where STATE='CA'

with ApTbl do

begin

 Query( 'STATE="CA"' ); 

 GoTop; 

 while not Eof do 

 begin 

         SetQueryBit( RecNo, False ); 

         Skip( 2 ); 

 end; 

end;

C++Builder Example

// Filters out every other record where STATE="CA"

ApTbl->Query( "STATE='CA'" );

ApTbl->GoTop();

while ( !ApTbl->Eof() )

{

 ApTbl->SetQueryBit( ApTbl->RecNo, false ); 

 ApTbl->Skip( 2 ); 

}

See Also

GetQueryBit, RYOFilterSetBit, Query