xHarbour Reference Documentation > Command Reference |
Specifies visibility of records marked for deletion.
SET DELETED on | OFF | ( <lOnOff> )
The SET DELETED setting controls the visibility of records marked for deletion. A deletion mark is set with the DELETE command and can be removed with RECALL. SET DELETED is a global setting valid for all work areas. To suppress visibility of deleted records in a single work area, SET DELETED to OFF and use a filter expression like SET FILTER TO Deleted().
Visibility of deleted records is suppressed while navigating the record pointer with SKIP, GO TOP or GO BOTTOM. During such relative navigation, all records carrying the deleted flag are ignored. Absolute navigation with GOTO <nRecordNumber>, however, allows for positioning the record pointer to a deleted record even when SET DELETED is ON.
Note: The SET DELETED setting has no effect on index creation with INDEX or REINDEX.
See also: | DbDelete(), DbRecall(), DELETE, Deleted(), RECALL, Set(), SET FILTER |
Category: | Database commands , SET commands |
Source: | rtl\set.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// This example illustrates the effect of SET DELETED PROCEDURE Main USE Customer EXCLUSIVE DELETE NEXT 3 // deletes record 1-3 GOTO 1 // go to record #1 SET DELETED ON // Ignore deleted records SKIP 3 // skip 3 records // (first three are ignored) ? Recno(), Deleted() // result: 6 .F. RECALL ALL // has no effect since // DELETED is ON GO TOP // first logical record ? Recno(), Deleted() // result: 4 .F. GOTO 1 // absolute navigation ? Recno(), Deleted() // result: 1 .T. SET DELETED OFF RECALL ALL // removes all deletion flags GO TOP // first logical record ? Recno(), Deleted() // result: 1 .F. CLOSE Customer RETURN
http://www.xHarbour.com