SetDeleted Function (Logic) | |
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.21
Syntax FUNCTION SetDeleted(
lNewSetting AS LOGIC
) AS LOGIC
public static bool SetDeleted(
bool lNewSetting
)
Request Example
View SourceParameters
- lNewSetting
- Type: Logic
TRUE ignores deleted records; FALSE processes deleted records.
The initial default is FALSE.
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 |
---|
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():
1USE sales NEW
2? LastRec()
3DELETE RECORD 4
4COUNT TO nCount
5? nCount
6SetDeleted(TRUE)
7COUNT TO nCount
8? nCount
See Also