Skip to content

UndoType - DfBaseRichEdit

Returns type of undo operation at top of undo queue

Type: Function
Return Data Type: integer

Syntax

Function UndoType Returns integer

Call Example

Get UndoType to integerVariable

Description

Returns the type of undo operation at the top of the undo queue.

If the undo queue for the control is not empty, the value returned indicates the type of the next action in the control's undo queue. If there are no undoable actions or the type of the next undoable action is unknown, the return value is zero (Unknown).

The types of actions that can be undone or redone include typing, delete, drag-drop, cut, and paste operations. This information can be useful for applications that provide an extended user interface for undo and redo operations, such as a drop-down list box of redoable actions

This function has no effect if control is not paged.

Possible return values are:

Constant Meaning
utUnknown Unknown
utTyping Typing
utDelete Delete
utDragDrop Drag and Drop
utCut Cut
utPaste Paste

Sample

This sample determines the next undo operation type available for control oRichEdit1 and displays it to the user in a message box.

Procedure CheckUndoType
    integer iUndoType
    string sUndoType

    get UndoType of oRichEdit1 to iUndoType

    if (iUndoType = utUnknown) ;
        send Info_Box "No undo operations available"
    else begin
        if (iUndoType = utTyping) move "Typing" to sUndoType
        else if (iUndoType = utDelete) move "Delete" to sUndoType
        else if (iUndoType = utDragDrop) move "DragDrop" to sUndoType
        else if (iUndoType = utCut) move "Cut" to sUndoType
        else if (iUndoType = utPaste) move "Paste" to sUndoType

        send Info_Box sUndoType "Next Undo operation available"
    end
End_Procedure  // CheckUndoType

Return Value

Type of undo operation at the top of the undo queue.