xHarbour Reference Documentation > Function Reference |
Queries the Deleted flag of the current record
Deleted() --> lIsDeleted
The function returns .T. (true) if the current record is marked for deletion, otherwise .F. (false) is returned.
The Deleted() function queries the Deleted flag of the current record. By default, it operates in the current work area. Use an aliased expression to retrieve the flag from a different work area.
The Deleted flag is set with function DbDelete() and can be removed with DbRecall(). Whether or not a record carries this flag is the task of the Deleted() function.
Note that records marked for deletion are not visible during database navigation when SET DELETED is set to ON.
See also: | DbRecall(), DbRecordInfo(), DELETE, PACK, RECALL, SET DELETED |
Category: | Database functions |
Source: | rdd\dbcmd.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// This example uses Deleted() as part of an index expression so that // all records carrying the deleted flag appear at the end of a database. // This allows for an elegant technique of record recycling when new // data must be stored. If a record is Deleted() its data is overwritten, // otherwise a new record is appended. PROCEDURE Main USE Customer NEW INDEX ON IIf(Deleted(), Chr(255)+LastName, LastName+Chr(32) ) ; TO Cust01 GO BOTTOM IF Deleted() nRecno := Recno() DbRecall() ELSE APPEND BLANK nRecno := Recno() ENDIF GOTO nRecno <assign new customer data here> USE RETURN
http://www.xHarbour.com