general undo methods?

Chipp Walters chipp at
Sun Feb 20 04:23:35 EST 2005

Richard Gaskin wrote:

> That's prettyt much where I'm headed now, but there's one aspect that's 
> still problematic:  Rev's built-in undo for text editing operations is 
> something I don't want to replicate.  For a single-level Undo it's easy 
> enough to put a flag in the undo string to tell it to use the built-in 
> undo command rather than any custom routine.  But how would one handle 
> this for multi-level undo?

Richard, I'm sure you've already thought of this, but why not create a 
number of customProps in a customPropSet:


where 'fred' refers to a field name and the number refers to the last 
change made.

Then each time a close field is sent to the "fred" fld, store the 
htmlText of the field in the appropriate customProp. Then it's a simple 
matter to find the highest number and 'undo' to the htmlText of it.

StripAndShip will kill the whole property set.

I'm sure you already thought of this, but thought I'd mention it anyway.


More information about the use-livecode mailing list