<< Click to Display Table of Contents >> Navigation: Apollo VCL Components > Apollo VCL Component Reference > TApolloTable > TApolloTable Methods > RYOFilterCreate |
Declaration
function RYOFilterCreate : Integer;
Description
Creates an empty bitmap to be used in subsequent RYOFilter functions. Each bit in the bitmap represents one physical record in the table. If the bit is ON, the record will be visible when the RYO Filter is activated. If the bit is OFF, the record will be filtered out of the visible data set.
Bitmapped filter operations are used by the Apollo query engine to provide ultra high speed filtering. The RYOFilter functions allow the applications programmer to create custom bitmapped filters.
RYOFilter bitmaps may be removed from memory with RYOFilterDestroy. They are also destroyed when the table is closed.
Return Value
Returns an integer handle that will subsequently identify this bitmap in further RYOFilter operations. If the result is zero, the operation failed.
Delphi Example
procedure TForm1.Button1Click(Sender: TObject);
begin
if Button1.Caption = 'Activate Filter' then
begin
ApTbl.RYOFilterActivate( hBitMap, RYOFILTER_NEW );
Button1.Caption := 'Clear Filter';
end
else
begin
// Deactivate active bitmap; does not destroy it
ApTbl.RYOFilterDestroy( 0 );
// Destroys bitmap, freeing allocated memory
ApTbl.RYOFilterDestroy( hBitMap );
// Create new, empty bitmap
hBitMap := ApTbl.RYOFilterCreate;
Button1.Caption := 'Activate Filter';
end;
ApTbl.First;
ApTbl.Refresh;
end;
C++Builder Example
void __fastcall TForm1::Button1Click(TObject *Sender)
{
if (Button1->Caption == "Activate Filter")
{
ApTbl->RYOFilterActivate( hBitMap, RYOFILTER_NEW );
Button1->Caption = "Clear Filter";
}
else
{
// Deactivate active bitmap; does not destroy it
ApTbl->RYOFilterDestroy( 0 );
// Destroys bitmap, freeing allocated memory
ApTbl->RYOFilterDestroy( hBitMap );
// Create new, empty bitmap
hBitMap = ApTbl->RYOFilterCreate();
Button1->Caption = "Activate Filter";
}
ApTbl->First();
ApTbl->Refresh();
}
See Also
RYOFilterActivate, RYOFilterCopy, RYOFilterDestroy, RYOFilterRestore, RYOFilterSave, RYOFilterSetBit