Rebuild all orders in the order list of a work area.
XSharp.RT (in XSharp.RT.dll) Version: 2.16
By default, this function operates on the currently selected work area.
It can be made to operate on an unselected work area by specifying
it within an aliased expression
All orders are rebuilt, respecting uniqueness and descending order flags and the for condition specified when the order was created.
After the orders are rebuilt, the work area is positioned to the first logical record in the controlling order.
Although this operation will work in both shared and exclusive mode, exclusive mode is highly recommended. See SetExclusive() for more information.
Caution! DBReindex() does not recreate the header of the index file when it recreates the order. Because of this, DBReindex() does not help if there is corruption of the file header.
To guarantee a valid index, always use DBCreateIndex() in place of DBReindex() to rebuild damaged index files
This example issues a DBReindex() if a particular record is not found:
3DBUseArea(TRUE,, "customer",, FALSE)
8 ? "Referential integrity failure:"
9 ? "The last Address record was not found in the"
10 ? "Customer index file. Index is not up-to-date"
11 ? "or the record is missing. Reindexing ..."
12 IF !DBReindex()
13 ? "Reindexing failed"
DbSetOrderCondition(Usual, Usual, Usual, Usual, Usual, Usual, Usual, Usual, Usual, Usual, Usual, Usual, Usual, Usual, Usual)