xHarbour Reference Documentation > Function Reference |
Opens and optionally activates a new index in a work area.
OrdListAdd( <cIndexFile> ) --> NIL
The function always returns NIL.
OrdListAdd() opens an index file in a used work area and adds all contained indexes to the list of open indexes. If <cIndexFile> is the first index file opened in the work area, the first index stored in the file becomes the controlling index and the record pointer is moved to the first logical record. If there is a controlling index already active when OrdListAdd() is called, both, record pointer and controlling index, remain unchanged.
See also: | DbClearIndex(), DbCreateIndex(), DbReindex(), DbSetOrder(), OrdCreate(), OrdListClear(), OrdListRebuild(), SET INDEX |
Category: | Database functions , Index functions |
Source: | rdd\dbcmd.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example shows the effect of OrdListAdd() when an index is opened // a first index in a work area vs. the situation when an additional index // is opened. PROCEDURE Main USE Customer INDEX ON Upper( LastName ) TO Cust01 INDEX ON Upper( FirstName ) TO Cust02 // reopening the database closes all indexes USE Customer ? Recno(), LastName // result: 1 Miller OrdListAdd( "Cust01" ) ? Recno(), LastName // result: 20 Alberts OrdListAdd( "Cust02" ) ? Recno(), LastName // result: 20 Alberts USE RETURN
http://www.xHarbour.com