procedure setFilter (expression : String );
Function setFilter() filters records by some condition.
The function does not change a file, it filters records in a memory.
To return the original state of a table - call unsetFilter().
By default case of letters is ignored. You can change the default behaviour with function caseSensitiveMode().
You can use the following operators in the expression:
You can use & and | to unite expressions
procedure unsetFilter;
procedure caseSensitiveMode(sensitive : Boolean);
The function does not change a file, it filters records in a memory.
To return the original state of a table - call unsetFilter().
By default case of letters is ignored. You can change the default behaviour with function caseSensitiveMode().
You can use the following operators in the expression:
| Operation | Meaning | Example |
|---|---|---|
| < | Less | FIELD1<123 |
| > | More | FIELD1>123 |
| = | Equal for numbers, begin with for strings | FIELD1=123 FIELD2=john |
| == | Equal for numbers, exact equal for strings | FIELD2==john FIELD2==john lennon |
| <> | Do not equal | FIELD1<>123 |
| <= | Less or equal | FIELD1<=123 |
| >= | More or equal | FIELD1>=123 |
| ~ | Contain a substring | FIELD2~lennon |
| ^ | Do not contain a substring | FIELD1^lennon |
procedure caseSensitiveMode(sensitive : Boolean);
begin
// your code
dbf.setFilter('FIRSTNAME=john');
writeln( 'Reccount = ' + intToStr( dbf.recCount ) );
dbf.caseSensitiveMode(True);
dbfsetFilter('FIRSTNAME=john');
writeln( 'Reccount = ' + intToStr( dbf.recCount ) );
// your code
dbf.unsetFilter;
end;