Hi Paul and all,

> Am 21.05.2021 um 17:05 schrieb Paul Dupuis via use-livecode 
> <[email protected]>:
> 
> As other have said, the basic mechanism is to have a UNDO LIFO (last in first 
> out) queue or stack (no LC stack for a data structure stack). For each action 
> you want 'undoable" you need a handler (do[action] ) to perform that action 
> that also adds a record (a line) to the queue (a property, global variable, 
> or script variable) that puts enough information in that record to undo the 
> action. You then you have a corresponding undo[action] handler that can take 
> the record from the queue and reverse the action.
> 
> So records on the queue might look like:
> changeFont <oldFont> <newFont> <chunk>  -- which can be undone by setting the 
> <chunk> to <oldFont>
> resizeImage <oldSize> <newSize>
> etc.
> 
> The first item tells you action was done and the subsequent items provide 
> enough information to undo (or do again or redo) the action.

thank you very much for all the hints and examples!
Great inspiration and very encouraging. :-)


Best

Klaus

--
Klaus Major
https://www.major-k.de
https://www.major-k.de/bass
[email protected]


_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to