xHarbour Reference Documentation > Function Reference |
Deletes an index from an index file.
OrdDestroy( <cIndexName> [, <cIndexFile>] ) --> NIL
The function always returns NIL.
OrdDestroy() deletes an open index and removes it from an index file. If the index file contains only one index, the file is erased from disc. When the controlling index is removed, no index is active after OrdDestroy() returns and the database is navigated in physical order. Function OrdNumber() returns 0 in that case, although other indexes may be open. Use OrdSetFocus() to activate another index.
See also: | DELETE TAG, OrdCreate() |
Category: | Database functions , Index functions |
Source: | rdd\dbcmd.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example creates two indexes and destroys the controlling // index. PROCEDURE Main USE Customer OrdCreate( "Customer1", "ID" , "CUSTNO" ) OrdCreate( "Customer2", "NAME", "Upper(LastName+FirstName)" ) OrdSetFocus( "ID" ) ? OrdNumber() // result: 1 ? OrdName() // result: ID ? OrdKey() // result: CUSTNO ? OrdSetfocus( "NAME" ) // result: ID ? OrdName() // result: NAME ? OrdNumber() // result: 2 ? OrdKey() // result: Upper(LastName+FirstName) OrdDestroy( "NAME" ) ? OrdNumber() // result: 0 ? OrdName() // result: (empty string) ? OrdKey() // result: (empty string) USE RETURN
http://www.xHarbour.com