Returns the name of an open index (.IDX) file for the current or specified table.
NDX(nIndexNumber [, nWorkArea | cTableAlias])
- Specifies which .idx file name to return. USE and SET INDEX both support an index file list that makes it possible for you to open .idx files for a table. The order of the file names in this index file list determines which .idx file name NDX(В ) returns. For example, if nIndexNumber is 1, NDX(В ) returns the name of the first .idx file in the index file list; if nIndexNumber is 2, NDX(В ) returns the second .idx file name, and so on. NDX(В ) ignores names of compound index (.cdx) files in the index file list. NDX(В ) returns an empty string if nIndexNumber is greater than the number of .idx files in the index file list.
- Specifies the work area number for .IDX files open in a work area other than the current one. NDX(В ) returns an empty string if no table is open in the work area you specify. If you omit nWorkArea, NDX(В ) returns the names of .idx files open with the table in the current work area.
- Specifies the table alias for .idx files open in a work area other than the current one. If no table has the alias you include, Visual FoxPro generates an error message. If you omit cTableAlias, NDX(В ) returns the names of .idx files open with the table in the current work area.
The CDX(В ) and MDX(В ) functions can be used to return the names of open compound (.cdx) index files.
In Visual FoxPro for Windows, when SET FULLPATH is ON, NDX(В ) returns the path to the .idx file with the .idx file name. When SET FULLPATH is OFF, NDX(В ) returns the drive the .idx file resides on with the .idx file name.