Function OrdBagExt() Foundation

Returns the default extension for index file names.

Syntax
OrdBagExt() --> cExtension
Return

The return value of OrdBagExt() depends on the database engine (DBE) managing the files in the work area. When the DBFNTX DBE is being used, OrdBagExt() returns the character string ".NTX". For another DBE, the character string containing the default extension for index file names under that DBE would be returned. If no database file is open in the work area, the default extension for index files from the DBE defined as the default using DbeSetDefault() is returned. If no DBE is loaded, the function returns a null string ("").

Description

OrdBagExt() determines the default extension for index file names. This allows checking for the existence of an index file without knowing which database engine will be used to manage the index file.

Examples
OrdBagExt()
// 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 with OrdBagExt(). 

PROCEDURE Main 
   USE Customer NEW EXCLUSIVE 

   IF .NOT. File("CUSTA" + OrdBagExt()) 
      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.