Function IndexExt() Foundation

Returns the default extension for index file names.

Syntax
IndexExt() --> cExtension
Return

The return value of IndexExt() depends on the database engine (DBE) managing the files in the work area. When the DBFNTX DBE is being used, IndexExt() returns the character string ".NTX". For another DBE, a character string containing the default extension for index file names under that DBE is returned.

Description

The function IndexExt() exists for compatibility reasons. The function OrdBagExt() should be used instead of IndexExt().

IndexExt() determines the default extension for index files. This allows checking for the existence of an index file without knowing which database engine will manage the index file.

Examples
IndexExt()

// In the example, the function File() tests whether an 
// index file is available. Since various database engines 
// use different file extensions, the file extension 
// is determined using IndexExt(). 

PROCEDURE Main 
   USE Customer NEW EXCLUSIVE 

   IF .NOT. File("CUSTA" + IndexExt()) 
      INDEX ON Upper(LastName+FirstName) TO CustA 
   ENDIF 

   USE 
RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.