Delete the current record or the records specified with the scoping parameters.
VORDDClasses (in VORDDClasses.dll) Version: 2.7
Syntax Request Example
VIRTUAL METHOD Delete(
cbForBlock AS USUAL := NIL,
cbWhileBlock AS USUAL := NIL,
uScope AS USUAL := NIL
) AS USUAL
public virtual Usual Delete(
Usual cbForBlock = null,
Usual cbWhileBlock = null,
Usual uScope = null
- 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 current 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.
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.
DBSCOPEREST The scope is the remaining records in the table from the current position.
<nRecords> The scope is the next <nRecords> records.
TRUE if successful; otherwise, FALSE. Note that after a FALSE indication of a scoped operation, some records can have been deleted: the operation can have failed halfway through because of lock conflicts or technical problems.
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.
|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