Compartir a través de


SYS(2021) - Filtered Index Expression

Returns the filter expression for an open single-entry index (.idx) file or filter expressions for tags in compound index (.cdx) files.

SYS(2021, nIndexNumber [, nWorkArea | cTableAlias])

Return Value

Character

Parameters

  • nIndexNumber
    The numeric expression nIndexNumber specifies which filter expression to return from the open index files. SYS(2021) returns filter expressions from open index files in the following order as nIndexNumber increases from 1 to the total number of open single-entry .idx files and structural compound and independent compound index tags:

    1. Filter expressions from single-entry .idx files (if any are open) are returned first. The order in which the single-entry .idx files are included in USE or SET INDEX determines the order in which the filter expressions are returned.

    2. Filter expressions for each tag in the structural .cdx file (if one is present) are returned next. The filter expressions are returned from the tags in the order the tags were created in the structural index.

    3. Filter expressions for each tag in any open independent .cdx files are returned last. The filter expressions are returned from the tags in the order the tags were created in the independent compound indexes.

    The empty string is returned if nIndexNumber is greater than the total number of open single-entry .idx files and structural and independent .Cdx file tags.

  • nWorkArea
    Specifies the work area number for a table open in another work area.

  • cTableAlias
    Specifies a table alias for a table open in another work area. If a table doesn't have the alias you specify, Visual FoxPro displays an error message.

Remarks

You can create filtered indexes in Visual FoxPro. If you include the optional FOR clause in INDEX, the index file acts as a filter on the table. Only records that match the filter expression lExpression in the FOR clause are available for display and access. Index keys are created in the index file for only those records matching the filter expression.

The empty string is returned if an index or index tag was created without a FOR clause.

USE and SET INDEX both support an index file name list that makes it possible for you to open index files for a table. Any combination of single-entry .idx file names, structural .cdx file names, and independent .cdx file names may be included in the index file name list.

SYS(2021) returns filter expressions from index files open in the current work area unless you include a specific work area or alias.

See Also

Reference

CDX( ) Function

KEY( ) Function

INDEX Command

MDX( ) Function

NDX( ) Function

REINDEX Command

SET INDEX Command

SET ORDER Command

SYS( ) Functions Overview

TAG( ) Function