Click or drag to resize

DbServer.Delete Method (Usual, Usual, Usual)

X#
Delete the current record or the records specified with the scoping parameters.

Namespace:  VO
Assembly:  VORDDClasses (in VORDDClasses.dll) Version: 2.21
Syntax
 VIRTUAL METHOD Delete(
	cbForBlock,
	cbWhileBlock,
	uScope
) AS USUAL CLIPPER
Request Example View Source

Parameters

cbForBlock (Optional)
Type: Usual
The condition evaluated for each record in the scope; if TRUE, the record is included in the processing. It provides the same functionality as the FOR clause of record processing commands.
cbWhileBlock (Optional)
Type: Usual
The condition evaluated for each record from the first record until the condition returns FALSE. It provides the same functionality as the WHILE clause of record processing commands.
uScope (Optional)
Type: Usual
The range of records to process, providing the same functionality as the ALL, REST and NEXT clauses of record processing commands.
ConstantDescription
DBSCOPEALL The scope is all the records in the table. This is the default, although if a WHILE condition is specified, the scope becomes DBSCOPEREST.
DBSCOPERESTThe scope is the remaining records in the table from the current position.

Return Value

Type: Usual
TRUE if successful; otherwise, FALSE (although some records still might have been processed).
Remarks
If called with a scope or if a server scope is active, Delete() sends a NotifyIntentToMove message before the operation, and a NotifyFileChange upon completion (regardless of the number of records actually deleted). If no scope is used and Delete() applies to the current record only, it sends a NotifyRecordChange message, if successful.
If a scope is specified, on successful completion, the current record will be the last file record and DBServer:EOF will be TRUE.
Important! Since the scope is persistent, a scope left around from processing a method like CopyDB() or Average() could cause Delete() to process too many records. Remember to reset a scope after it has been used. Even though the record is marked for deletion, it remains in the file and can be recalled. (The current setting of the SetDeleted() function affects whether deleted records are visible.) If changes have been made to fields, the changes are recorded in the record before it is flagged as deleted; thus, if the field is recalled, it correctly reflects any changes made before the delete operation.
Tip Tip
DBServer:Delete() does not advance to the next record after the deletion takes place, unlike DataWindow:Delete() which does (if SetDeleted() is TRUE).
See Also