共用方式為


MDX( ) Function

Returns the name of the open .cdx compound index file that has the specified index position number.

MDX(nIndexNumber [, nWorkArea | cTableAlias])

Return Values

Character

Parameters

  • nIndexNumber
    Specifies which compound index file name to return. If the table has a structural compound index file and nIndexNumber is 1, the name of the structural compound index file (which is always the same as the name of the table) is returned. If nIndexNumber is 2, the name of the first compound index file specified with USE or SET INDEX is returned. If nIndexNumber is 3, the second compound index file name is returned, and so on. If nIndexNumber is greater than the number of open compound index files, an empty string is returned.

    If the table doesn't have a structural compound index file and nIndexNumber is 1, the name of the first compound index file specified with USE or SET INDEX is returned. If nIndexNumber is 2, the second compound index file name is returned, and so on. If nIndexNumber is greater than the number of open compound index files, an empty string is returned.

  • nWorkArea
    Specifies the work area number for compound index files open in work areas other than the current one. If you omit this optional argument, names of compound index files are returned for the current work area.

  • cTableAlias
    Specifies the table alias for compound index files open in work areas other than the current one. If you omit this optional argument, names of compound index files are returned for the current work area.

Remarks

MDX( ) is identical to CDX( ).

Index files can be opened for a table with the INDEX clause of the USE command or with SET INDEX. A structural compound index file is automatically opened with its table. MDX( ) ignores any .idx index files specified with USE or with SET INDEX.

Use TAG( ) to return tag names from a compound index file; use NDX( ) to return the name of an open .idx index file.

In Visual FoxPro for Windows, when SET FULLPATH is ON, MDX( ) returns the path to the .cdx file with the .cdx file name. When SET FULLPATH is OFF, MDX( ) returns the drive the .cdx file resides on with the .cdx file name.

See Also

CDX( ) | INDEX | NDX( ) | SET INDEX | SET FULLPATH | SYS(14) - Index Expression | TAG( ) | USE