general undo methods?

Richard Gaskin ambassador at fourthworld.com
Fri Feb 18 19:53:33 EST 2005


Thomas McGrath III wrote:

 > On Feb 18, 2005, at 3:53 PM, Richard Gaskin wrote:
 >
 >> I need to add more extensive undo to an app I'm working on.  Seems
 >> like a lot of work once you step outside of the subset of things the
 >> engine takes care of for you.
 >>
 >> Any of you have pointers to general methods for implemening undo
 >> across an app?
 >
 > If your using substacks you can save in different states (upon any
 > changes or significant changes) with a smart numbering system(backup
 > system) and then if/when the user saves, it writes a final version and
 > deletes the previous ones.
 > That's the simpler way.
 >
 > Other wise all kinds of things need to be kept track off to be able to
 > undo them.

I just spent the last two hours reading up on how undo is done in other 
systems, and it seems that there is no magic panaea in any of them. 
Good undo is simply a lot of work.

The general method is to atomize your code so that every action the user 
can do generates undo code stored in a queue, which is then invoked when 
Undo is selected.

The discipline of writing such well-factored code appeals to the OCD 
side of me, but the need to do it in short order to get a project out 
the door doesn't. :)

Looks like I've found my presentation topic for the Monterey conference....

-- 
  Richard Gaskin
  Fourth World Media Corporation
  ___________________________________________________________
  Ambassador at FourthWorld.com       http://www.FourthWorld.com



More information about the use-livecode mailing list