Show/Hide Toolbars

XSharp

NoteThis command is defined in a header file and will be preprocessed by the X# preprocessor to a function call. If you disable the standard header (-nostddefs) files then this command will not be available. If you tell the compiler to use a different standard header file (-stddef ) then this command may also be not available

Purpose

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

Syntax

REINDEX [EVAL <lCondition> [EVERY <nRecords>]

Arguments

EVAL <cbEval>A code block that is evaluated at intervals specified by EVERY <nInterval>.  The default interval is 1.  This is useful in producing a status bar or odometer that monitors the ordering progress.  The return value of <cbEval> must be a logical value.  If <cbEval> returns FALSE, indexing halts.

 

EVERY <nInterval>A numeric expression that determines the number of times <cbEval> is evaluated.  This option offers a performance enhancement by evaluating the condition at intervals instead of for every record processed.  The EVERY keyword is ignored if you specify no EVAL clause.

Description

REINDEX is functionally equivalent to DbReindex().  

 

Caution! REINDEX does not recreate the header of the index file when it recreates the index.  Because of this, REINDEX does not help if there is corruption of the file header.  To guarantee a valid index, always use INDEX ON in place of REINDEX to rebuild damaged index files

Examples

The following example reindexes the orders in the current work area:

 

USE sales INDEX salesman, territory NEW
REINDEX

 

This example reindexes using a progress indicator:

 

USE sales INDEX salesman, territory NEW
REINDEX EVAL NtxProgress() EVERY 10
 
FUNCTION NtxProgress()
 LOCAL cComplete := LTRIM(STR((RECNO() / ;
                 LastRec()) * 100))
 @ 23, 00 SAY "Indexing..." + cComplete + "%"
RETURN TRUE

 

Assembly

XSharp.RT.DLL

a

See Also

DBCreateIndex(), DbCreateOrder(), DbReindex(), INDEX, PACK, SET INDEX, USE