xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

IndexExt()

Retrieves the default index file extension in a work area.

Syntax

IndexExt() --> cFileExtension

Return

The function returns the default file extension for index files in a work area. If a work area is unused, the return value is an empty string ("").

Description

The default extension for index files depends on the RDD used to open a database file. IndexExt() returns the default extension used by the RDD if an index file should be created and the file name is specified without extension. IndexExt() does not return the file extension of an index file in use.

Note:  The function exists for compatibility reasons. It is recommended to use OrdBagExt() instead.

Info

See also:DbInfo(), IndexKey(), IndexOrd(), OrdBagExt()
Category: Database functions , Index functions
Source:rdd\rddord.prg
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example checks the existence of an index file using
// the default file extension for indexes.

   PROCEDURE Main
      USE Customer NEW EXCLUSIVE

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

      USE
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe