Unit BDEFiltr

Classes

TFormFilterCallback - 0 for False, 1 for True

Functions

CodeFilterApply - CodeFilterDrop()
CodeFilterDrop - Filter handle to set

GetTableCursor()
OnlyEvenRecords - 0 for False, 1 for True

Filter information for the specific entry } { This function demonstrates accessing information from the callback without using the structure -- the physical record number is used instead
OnlyOddRecords - 0 for False, 1 for True

OnlyEvenRecords() } { This function demonstrates accessing information from the callback without using the structure -- the physical record number is used instead
TextInRecord - True if the passed filter was dropped

OnlyOddRecords() } { This function demonstrates accessing information from the callback structure by calling dbiGetCursorProps to determine the length of the record buffer, and by moving the record buffer into a string for the Pos() function

Types

dbiCodeFilter
dbiFilterCB

Constants

Variables

FormFilterCallback


Functions


function CodeFilterApply( { Apply a code filter to a data table } oDataset : TDataset; { Dataset to filter } codeFilter : dbiCodeFilter; { Pointer to the filtering function } var hFilter : hDBIFilter { Filter handle to set } ) : boolean;

CodeFilterDrop()

function CodeFilterDrop( { Drop a (code) filter from a dataset } oDataset : TDataset; { Dataset that is using passed filter } var hFilter : hDBIFilter { Filter to drop (could be any filter) } ) : boolean;

Filter handle to set

GetTableCursor()


function OnlyEvenRecords( { Only display even-numbered records } lFilterCB : longint; { Pointer to the Client data } pRecBuf : pByte; { Record buffer pointer to examine } ulPhyRecNum : longint { Physical record number (for dBASE tables) } ) : smallint {$IFDEF WIN32}stdcall;

0 for False, 1 for True

Filter information for the specific entry } { This function demonstrates accessing information from the callback without using the structure -- the physical record number is used instead


function OnlyOddRecords( { Only display odd-numbered records } lFilterCB : longint; { Pointer to the Client data } pRecBuf : pByte; { Record buffer pointer to examine } ulPhyRecNum : longint { Physical record number (for dBASE tables) } ) : smallint {$IFDEF WIN32}stdcall;

0 for False, 1 for True

OnlyEvenRecords() } { This function demonstrates accessing information from the callback without using the structure -- the physical record number is used instead


function TextInRecord( { Only display records with specified text } lFilterCB : longint; { Pointer to the Client data } pRecBuf : pByte; { Record buffer pointer to examine } lPhyRecNum : longint { Physical record number (for dBASE tables) } ) : smallint {$IFDEF WIN32}stdcall{$ENDIF};

True if the passed filter was dropped

OnlyOddRecords() } { This function demonstrates accessing information from the callback structure by calling dbiGetCursorProps to determine the length of the record buffer, and by moving the record buffer into a string for the Pos() function


Types


dbiCodeFilter = function(
      lFilterCB      : longint;  { Pointer to the Client data }
      pRecBuf        : pByte;    { Record buffer pointer to examine }
      lPhyRecNum     : longint   { Physical record number for dBASE tables
                                   Sequential record number for Paradox }
      )              : smallint {$IFDEF WIN32}stdcall{$ENDIF}
Any object to attach to the filter
dbiFilterCB = record
hCursor : hDBICur;
sFind : string;
bCaseSensitive : boolean;
oCargo : TObject;
end;
As long as the cursor is passed, anything else can also be declard in this structure. Just be sure to initialize the values first.

Constants


Variables

FormFilterCallback : TFormFilterCallback

Public declarations