Command SET DELETED Foundation

Sets whether records with deletion flags will be visible.

Syntax
SET DELETED on | OFF | <lToggle>
Scope
thread-local, current work space
Parameters
<lToggle>
<lToggle> is a logical expression which must appear in parentheses. Instead of a logical expression, the option ON can be specified for the value .T. (true) or OFF for the value .F. (false). When .T. or ON is specified, records marked for deletion are filtered and not visible.
Description

The command SET DELETED determines the visibility of records marked for deletion. When SET DELETED is ON, all records with deletion flags in all work areas are logically filtered out. File operations which move the record pointer skip all records which have the "Deleted" status. The exception is the command GOTO, which can position the record pointer to any record, even those which are filtered out. SET DELETED ON has no influence on index files created with INDEX ON or reorganized using REINDEX. Index files contain records whether or not they are marked for deletion.

SET DELETED must be OFF when the command RECALL ALL is executed. Otherwise, the deletion flag is retained for all "Deleted" records.

Examples
SET DELETED
// The example demonstrates the effect of SET DELETED. 

PROCEDURE Main 
   USE Customer NEW EXCLUSIVE 
   INDEX ON LName TO CustA 
   SET INDEX TO CustA 

   GO TOP 
   ? LName                      // result: Anderson 
   ? Deleted()                  // result: .F. 

   DELETE                       // set deletion flag 

   ? LName                      // result: Anderson 
   ? Deleted()                  // result: .T. 

   SET DELETED ON               // filter out records 
                                // marked for deletion 
   GO TOP 
   ? LName                      // result: Baker 
   ? Deleted()                  // result: .F. 

   CLOSE Customer 
RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.