次の方法で共有


FILTER( ) Function

Returns the table filter expression specified in SET FILTER.

FILTER([nWorkArea | cTableAlias])

Return Values

Character

Parameters

  • nWorkArea
    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.

  • cTableAlias
    Specifies the alias of the table for which FILTER( ) returns the filter expression.

    Visual FoxPro generates an error message if you specify a table alias that doesn't exist.

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.

Example

CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\testdata')
USE customer  && Opens Customer table
SET TALK ON
SET FILTER TO SUBSTR(cust_id,1) = 'B'

CLEAR
? FILTER( )  && Display filter expression
STORE FILTER('customer') TO gcOldFilter    && Save filter expression
SET FILTER TO country = 'USA'
? FILTER( )  && Display filter expression
SET FILTER TO &gcOldFilter    && Restore filter expression
? FILTER( )  && Display filter expression

LIST FIELDS cust_id, contact  && Demonstrate filter condition

See Also

SET FILTER | Filter Property