xHarbour Reference Documentation > Function Reference |
Marks an index entry as deleted in a HiPer-SEEK index file.
HS_Delete( <nHsxHandle>, <nIndexEntry> ) --> nErrorCode
The function returns 1 when the index entry is successfully marked as deleted, or a negative numeber indicating an error condition:
Error codes of HS_Delete()
Value | Description |
---|---|
-4 | Error while attempting to seek during buffer flushing. |
-5 | Read error while reading. |
-6 | Write error during buffer flushing. |
-7 | <nIndexEntry> is out of bounds. |
-8 | <nIndexEntry> is already marked for deletion. |
-16 | Invalid parameters are passed. |
-18 | Illegal HiPer-SEEK index file handle. |
HS_Delete() marks an index entry as deleted, but actually does not remove the entry from the file. The deletion mark can be removed with HS_Undelete(). This is similar to DbDelete() and DbRecall().
See also: | DbDelete(), HS_IfDel(), HS_Replace(), HS_Undelete() |
Category: | Database functions , HiPer-SEEK functions , Index functions , xHarbour extensions |
Source: | rdd\hsx\hsx.c |
LIB: | lib\xhb.lib |
DLL: | dll\xhbdll.dll |
// The example creates a new HiPer-SEEK index file and // transfers the Deleted() flag from the database to // the index. PROCEDURE Main LOCAL bIndex, nHandle, nIndex CLS USE Customer SET DELETED OFF nHandle := HS_Create( "Customer.hsx", 8, 3, .F., 2 ) bIndex := {|| Trim(LastName)+" "+Trim(FirstName) } DO WHILE .NOT. Eof() nIndex := HS_Add( nHandle, bIndex ) IF Deleted() HS_Delete( nHandle, Recno() ) ENDIF SKIP ENDDO HS_Close( nHandle ) USE RETURN
http://www.xHarbour.com