xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

SET DELETED

Specifies visibility of records marked for deletion.

Syntax

SET DELETED on | OFF | ( <lOnOff> )

Arguments

on | OFF | ( <lOnOff> )
This option toggles whether records marked for deletion are visible or not. The default is OFF or .F. (false), i.e. all records are visible. To change the setting use ON or .T. (true) as parameter. The parameter can also be specified as a logical expression enclosed in parentheses.

Description

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.

Info

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

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe