Notes of a Clipper Language Student

Menu

C5_DBREINDEX

DBREINDEX()
Recreate all active indexes for the current work area
------------------------------------------------------------------------------
SyntaxDBREINDEX() --> NILReturns
DBREINDEX() always returns NIL.
Description
DBREINDEX() rebuilds all active indexes associated with the current work
area. After the indexes are recreated, the work area is moved to the
first logical record in the controlling order.
DBREINDEX() performs the same function as the standard REINDEX command.
For more information, refer to the REINDEX command.
Examples. The following example reindexes the work area:
cLast := "Winston"
DBUSEAREA( .T., "DBFNTX", "Sales", "Sales", .T. )
DBSETINDEX( "LASTNAME" )
//
IF ( Sales->(DBSEEK(cLast)) )
IF RLOCK()
DELETE FOR Sales->LastName == "Winston"
Sales->( DBREINDEX() )
ELSE
? "Unable to lock record..."
ENDIF
ELSE
? "Not found"
ENDIF
Files Library is CLIPPER.LIB.