Returns the filter expression for an open single-entry index (.idx) file or filter expressions for tags in compound index (.cdx) files.
Syntax
SYS(2021, nIndexNumber [, nWorkArea | cTableAlias])
Returns
Character
Arguments
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:
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 lets you 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.