CanUndo

Description

Tests whether Undo can reverse the most recent edit for an editable control.

Applies to

Any editable control (DataWindow, MultiLineEdit, SingleLineEdit, RichTextEdit)

Syntax

editname.CanUndo ( )

Argument

Description

editname

The name of the DataWindow control, MultiLineEdit, SingleLineEdit, or RichTextEdit for which you want to determine whether the last edit can be reversed by the Undo function. In a DataWindow, CanUndo applies to the edit control over the current row and column.


Return value

Boolean. Returns true if the last edit can be reversed (undone) using the Undo function and false if the last edit cannot be reversed. If editname is null, CanUndo returns null.

Examples

These statements check to see if the last edit in mle_contact can be reversed; if yes the statements reverse it, and if no they display a message:

IF mle_contact.CanUndo() THEN
    mle_contact.Undo()
ELSE
    MessageBox(Parent.Title, "Nothing to Undo")
END IF

See also

Undo