Return a filter.
XSharp.RT (in XSharp.RT.dll) Version: 2.10
Syntax View Source
FUNCTION DbFilter() AS STRING
public static string DbFilter()
The filter condition defined in a work area. If no filter has been set, DBFilter() returns a NULL_STRING.
DBFilter() is a database function used to save and re-execute an active filter by returning the filter expression as a string.
By default, this function operates on the currently selected work area.
It can be made to operate on an unselected work area by specifying it within an aliased expression or by calling the overload that accepts a workarea parameter (a workarea number or alias ).
This function operates like the DBRelation() and DBRSelect() functions, which save and re-execute the linking expression of a relation within a work area.
Declared variables: A string returned by DBFilter() cannot operate correctly when recompiled and executed using the macro operator (&) if the original filter expression contained references to local or static variables or is otherwise dependent on compile-time declarations.
This example opens two database files, sets two filters, then displays the filter expressions for both work areas:
USE customer INDEX customer NEW
SET FILTER TO Last = "Smith"
USE invoices INDEX invoices NEW
SET FILTER TO CustId = "Smi001"
// Result: Last = "Smith"
// Result: Custid = "Smi001"