FILEFLEX API REFERENCE



NAME
DBUseIndex -- Open an index file

SYNTAX
DBUseIndex(index-file [, path-spec])

CATEGORY
Using Index Files

DESCRIPTION
THIS FUNCTION HAS CHANGED IN FILEFLEX 3.0

Indexes in FileFlex 3 use FoxPro's compact index format, called .CDX. This is different from indexes used in FileFlex 2.X, and you'll need to recreate any old FileFlex 2.X indexes prior to using them in FileFlex 3.

To open an index file, use the FileFlex DBUseIndex function. Supply the index file's name, including path name if needed, as an argument. Assign the result of this function to a global variable, since you'll need to refer to its database ID in other scripts and handlers.

Alternatively, you can split the path specification into two parameters: the first the actual file name and the second the path specification. In the runtime, the path specification will remain unchanged but the database file name will be decrypted:


NOTES
Indexes are tied to their original data files (this makes sense because you can't index data in a file that doesn't have the data). As such, you must have the appropriate data file selected with a DBSelect function before calling DBUseIndex. Failure to do so usually results in FileFlex generating an error code, the user calling technical support, and said user being told to read this section again.

EXAMPLE
  put DBUseIndex("STARS") into starIndex
  put DBUseIndex("STARS","HD:DB Files:") into ndxID -- Developer FF
  put DBUseIndex("&#R*$","HD:DB Files:") into ndxID -- Runtime FF

SEE ALSO
DBUse, DBClose, DBCloseAll

INTERNAL FUNCTION NUMBER
7


Copyright © 1992-1998 by David Gewirtz, under license to Component Enterprises, Inc.
Contact: info@component-net.com

Casa de Bender