Purpose
The UndoInfo() function returns information about a window that supports Undo stack functionality. Currently, only Layout Designer windows support this. Returned information includes the number of items on the stack, and the name of the command that will be executed on Undo or Redo. You can issue this statement from the MapBasic window in MapInfo Pro.
Syntax
UndoInfo ( window_id attribute )
window_id is an integer window identifier for a Layout Designer window.
attribute is an integer code indicating what type of information to return. For a list of values, see the table below.
Return
See the table below.
Description
The UndoInfo() function returns information about a window that supports Undo stack functionality. Currently, only Layout Designer windows support this. Returned information includes the number of items on the stack and the name of the command that will be executed on Undo. The Undo stack is a mechanism that records one or more actions to apply undo and redo.
The UndoInfo() function returns information about a window that supports Undo stack functionality. Currently, only Layout Designer windows support this functionality.
The window_id parameter specifies which window to query. To obtain a window identifier, call the FrontWindow() function immediately after opening a window, or call the WindowID() function at any time after the window’s creation.
There are several attributes that UndoInfo() returns about the given window. The attribute parameter should be one of the codes from the following table. These codes are defined in the mapbasic.def.
attribute code | ID | UndoInfo() returns |
---|---|---|
UNDO_INFO_COUNT | 1 | Integer value: Returns the number of items on the undo stack. |
UNDO_INFO_UNDO_ACTION_NAME | 2 | String value: Returns the name of the action that will be executed for an undo action. |
UNDO_INFO_REDO_ACTION_NAME | 3 | String value: Returns the name of the action that will be executed for a redo action. |
UNDO_INFO_CAN_UNDO | 4 | Logical value: Returns true if an undo can be applied. |
UNDO_INFO_CAN_REDO | 5 | Logical value: Returns true if a redo can be applied. |
UNDO_INFO_ENABLED | 6 | Logical value: Returns true when an undo stack functionality is enabled (when executed actions are recorded on the undo stack). |
UNDO_INFO_CURRENT_POS | 7 | Integer value: Returns the current position in the undo stack. If nothing has been undone, this value is the same as UNDO_INFO_COUNT. |
See Also:
Set Undo statement FrontWindow() function WindowID() function