Command REINDEX Foundation

Rebuilds open index files in the current work area.

Syntax
REINDEX [COMPACT]
Parameters
COMPACT
The COMPACT option is ignored by Xbase++
Description

The index command REINDEX rebuilds the opened index files in the current work area. Following the rebuild, the record pointer is positioned on the first logical record of the controlling index.

REINDEX differs from INDEX ON in that the index files are not recreated. Only the sorting is reconstructed. If the file header of an index file is corrupted, it cannot be repaired using REINDEX. In this case, the index file must be recreated using INDEX ON.

The setting of SET UNIQUE and the FOR condition specified when the index is created using the command INDEX ON are stored in the index file and are used by the command REINDEX.

The function OrdListRebuild() is the functional equivalent of the command REINDEX.

Examples
REINDEX
// In the example, a file is opened with three index files 
// which are rebuilt using REINDEX 

PROCEDURE Main 
   USE Customer INDEX CustA, CustB, CustC 

   REINDEX 

   CLOSE Customer 

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.