general undo methods?

Lynch, Jonathan BNZ2 at CDC.GOV
Fri Feb 18 15:15:11 CST 2005


Hi Richard...

I have a suggestion that might work, if the memory requirements of your
app are not too large.

You could set it up so that every time you make a change, you create a
copy of the stack in memory. Actually, have like 5 copies of the stack
in memory, and for each change, you replace one of those stacks, and
keep a list in a global variable of where you are in the rotation
through those five copies in memory, so that you will always be able to
recall the latest stored version, and go back at least four more steps
beyond that. Once you get to a sixth copy in memory, you purge the first
copy, and at a 7th copy in memory, you purge the 2nd copy, etc...

Does that make sense? I can see the process in my head, but seem to have
a hard time putting it into words.

This would work if it was a handler that you called in various scripts -
but not for all keystrokes. For fields, you could have it in a
closefield handler, for buttons, you could have at the end of the
process of whatever the button does. Obviously, this would too
burdensome to use for every keyup event in a field.

What do you think?

-----Original Message-----
From: use-revolution-bounces at lists.runrev.com
[mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of Richard
Gaskin
Sent: Friday, February 18, 2005 3:54 PM
To: How to use Revolution
Subject: general undo methods?

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?

-- 
  Richard Gaskin
  Fourth World Media Corporation
  ___________________________________________________________
  Ambassador at FourthWorld.com       http://www.FourthWorld.com
_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list