Foxtools – Editor _EDUNDO

Version: 01.10.10 - last Update: Tuesday, October 13, 2009, 13:00:00

Previous ChapterFoxtools Home (Alphabetical TOC)Foxtools Home (Grouped TOC)Next Chapter See also:_EdRedo | _EdUndoOn

Foxtools Editor Support Functions


_EdUndo() undoes the most recent changes/edits in the editor session window passed in <nWHAND> parameter.

VFP Syntax

= _EdUndo(nWHAND)


[in] nWHAND

Fox-window handle of the editor session in question. If nWHANDL is no valid editor-session handle, an error “API call caused an exception” (Error 2028) is raised.


VOID - no evaluable return value, coz always TRUE.


_EdUndo() may be called more than once in a row to roll back more than one action. Edit actions that can be undone or reverted (using _EdUndo() and _EdRedo()) may be grouped enclosing them between _EdUndoOn() commands.

VFP Example(s)

Opening an editor session, activating undo-grouping, adding some text, finally doing one _EdUndo() to roll back the whole sequence:

*\\ Open editor session
*\\ set undo-grouping ON
lcText = "NEW TEST"
*\\ insert 1st word
= _EDINSERT(m.nWHAND,m.lcText,3)
*\\ new line
*\\ insert 2 words
= _EDINSERT(m.nWHAND, m.lcText, LEN(m.lcText))
*\\ new line
*\\ more words
lcText = "Much more TEXT"
= _EDINSERT(m.nWHAND,m.lcText, LEN(m.lcText))
= _EDINSERT(m.nWHAND,"!",1)
*\\ new line
*\\ Caret on row#1
*\\ Indent row#1 with 1 tab stop
*\\ set undo-grouping OFF
WAIT WINDOW "Press any key to UNDO all changes"

Previous ChapterFoxtools Home (Alphabetical TOC)Foxtools Home (Grouped TOC)Next Chapter