DbServer.SetFilter Method | ![X#](../icons/logo100.jpg) |
Set a filter condition.
Namespace:
VO
Assembly:
VORDDClasses (in VORDDClasses.dll) Version: 2.19
Syntax VIRTUAL METHOD SetFilter(
cbFilterBlock,
cFilterText
) AS USUAL CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public virtual Usual SetFilter(
Usual cbFilterBlock = default,
Usual cFilterText = default
)
Request Example
View SourceParameters
- cbFilterBlock (Optional)
- Type: Usual
The code block that expresses the filter condition in executable form. If the code block is omitted, the string version of the filter expression is macro-compiled into a code block. - cFilterText (Optional)
- Type: Usual
The filter condition. If omitted, the DBServer:Filter access method returns a NULL_STRING.
Return Value
Type:
Usual
TRUE if successful; otherwise, FALSE.
Remarks
Both arguments specify the filter expression, one in the form of a code block, one in the form of a string. Both arguments are optional, but at least one must be provided. The reason for specifying both versions is that a compiled code block is faster, while the string version can be reported back through the Filter access method. Obviously, if both forms are specified, they should define the same expression.
Examples
The following examples demonstrate the various methods of setting a filter using the DBServer:SetFilter(). The filter condition is customer numbers (CustNo) exceeding 20,000. Note the user of the GoTop() method to invoke the filter expression by moving the record pointer.
1
2oDBCust:SetFilter({||CustNo > 20000})
3oDBCust:GoTop()
4
5oDBCust:SetFilter({||CustNo > 20000}, "CustNo > 20000")
6oDBCust:GoTop()
7
8oDBCust:SetFilter(, "CustNo > 20000")
9oDBCust:GoTop()
10
11oDBCust:SetFilter(, [ Gender = '] + SELF:cGender + ['] )
12oDBCust:GoTop()
See Also