Click or drag to resize

Filter Function

X#
Returns the table filter expression specified in Set Filter.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.19
Syntax
 FUNCTION Filter(
	uArea
) AS USUAL CLIPPER
Request Example View Source

Parameters

uArea (Optional)
Type: Usual
Specifies the work area of the table for which Filter( ) returns the filter expression. Filter( ) returns the empty string if a table isn't open in the work area you specify.
Or
Specifies the alias of the table for which Filter( ) returns the filter expression.
X# generates an error message if you specify a table alias that doesn't exist.

Return Value

Type: Usual
Character
Remarks
If you omit the optional arguments, Filter( ) returns the filter expression for the table open in the currently selected work area. For more information about creating a filter, see Set Filter.
Examples
X#
 1Close Databases
 2Open Database (HOME(2) + 'Data\testdata')
 3Use customer  // Opens Customer table
 4Set TALK ON
 5Set Filter TO SUBSTR(cust_id,1) = 'B'
 6Clear
 7? Filter( )  // Display filter expression
 8STORE Filter('customer') TO gcOldFilter    // Save filter expression
 9Set Filter TO country = 'USA'
10? Filter( )  // Display filter expression
11Set Filter TO &gcOldFilter    // Restore filter expression
12? Filter( )  // Display filter expression
13LIST Fields cust_id, contact  // Demonstrate filter condition
See Also