Click or drag to resize

DataWindow.Delete Method (Typed)

X#
Delete the current record in the attached server and update the window based on the change.

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VOGUIClasses (in XSharp.VOGUIClasses.dll) Version: 2.21
Syntax
 VIRTUAL METHOD Delete() AS USUAL CLIPPER
Request Example View Source

Return Value

Type: Usual
TRUE if successful; otherwise, FALSE.
Remarks
When executed successfully, the data server from which the record was deleted sends a NotifyDelete message to all of its clients, including this data window. With some servers (notably DBServer), a deleted record is not removed from the server but is simply marked as deleted. Marked records are removed only when the file is packed, and until such time can be recalled. (With DBServer, the current setting of the SetDeleted() function affects whether deleted records are visible.) Changes that have been made to fields are recorded in the record before it is deleted; if the field is subsequently recalled, it correctly reflects any changes made before the delete operation.
Tip Tip
DataWindow:Delete() advances to the next record (if SetDeleted() is TRUE) after the deletion takes place, unlike DBServer:Delete() which does not.
DataWindow:Delete() does not check validation status before allowing a delete operation. If the window contains invalid data, it is discarded and the delete operation is completed. If you would prefer to validate before deletion, use DataWindow:DeleteValidated().
Tip Tip
Do not confuse clearing with deleting. Clearing a structure (such as a record or field) removes its contents. Deleting a structure, on the other hand, removes the actual structure.
See Also