Click or drag to resize

SetDeleted Function

X#
Return and optionally change the setting that determines whether to ignore or include records that are marked for deletion.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 FUNCTION SetDeleted() AS LOGIC
Request Example View Source

Return Value

Type: Logic
If lNewSetting is not specified, SetDeleted() returns the current setting.
If lNewSetting is specified, the previous setting is returned.
Remarks
SetDeleted() toggles automatic filtering of records marked for deletion in all work areas. When TRUE is specified, most commands ignore deleted records.
If, however, you refer to a record by record number (GOTO or any command that supports the RECORD scope), the record is not ignored, even if it is marked for deletion.
Additionally, TRUE has no effect on INDEX or reindexing. Note: RECALL ALL honors SetDeleted() and does not recall any records.
Tip Tip
Filtering deleted records in a single work area:
To confine the filtering of deleted records to a particular work area, select the work area, then set the filter to !Deleted().
Examples
This example illustrates the effect of using SetDeleted():
X#
1USE sales NEW
2? LastRec()                // 84
3DELETE RECORD 4
4COUNT TO nCount
5? nCount                    // 84
6SetDeleted(TRUE)
7COUNT TO nCount
8? nCount                    // 83
See Also