Click or drag to resize

Functions.VoDbOrdListRebuild Method

Rebuild all orders in the order list of a work area.
Rebuild all orders in the order list of a work area.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.18
Request Example View Source

Return Value

Type: Logic
TRUE if successful; otherwise FALSE.

Return Value

Type: Logic
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
VODBOrdListRebuild() is the same as DBReindex() except that it is strongly typed.
This function, however, does not call the error handler and will not, therefore, produce a runtime error message or create an error object if it fails. Thus, it may be important to check the return value to determine if the function succeeded.
The global structure, StrucErrInfo, will contain needed information regarding any error that occurs.
This example issues a DBReindex() if a particular record is not found:
 1DBUseArea(TRUE,, "Address")
 3DBUseArea(TRUE,, "customer",, FALSE)
 4    //Opens the file exclusively
 7IF !Found()
 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"
14        DBCloseAll()
15        QUIT
16    ENDIF