Function DbReindex() Foundation

Rebuilds open index files in a work area.

DbReindex() --> NIL

The return value of DbReindex() is always NIL.


The function DbReindex() exists for compatibility reasons. Instead of DbReindex() the function OrdListRebuild() should be used.

The index function DbReindex() rebuilds the open index files in a work area. When the function is used without the alias operator, the function rebuilds the open index files in the current work area. When the rebuild is complete, the record pointer is positioned on the first logical record of the controlling index.

Contrary to DbCreateIndex(), the index files are not completely recreated, only the sorting is rebuilt. If the file header of an index file is corrupted, this cannot be repaired with DbReindex(). In this case, the index file must be recreated with DbCreateIndex() or OrdCreate().

The command REINDEX can be used instead of DbReindex(). REINDEX is effective only in the current work area.

// In the example, a file is opened with three index files 
// which are rebuilt with DbReindex() 

   USE Customer INDEX CustA, CustB, CustC 


   CLOSE Customer 


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.