OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to make a undo/redo function [closed]

  • Thread starter Thread starter RainerS
  • Start date Start date
R

RainerS

Guest
I want to add a undo/redo function in my script. I have looked around and see some suggestions, most of them recommended to use command pattern.

The function must work over one page - after a reload of the page the function must able to redo/undo the last things.

I don't know how command pattern works, I think about to create a object, to store the a name of the function, the old and the new value - but I'm not sure if this is a efficient way to do this or not.

Maybe somebody could give me a small example how the code for a undo/redo function should look.

<p>I want to add a <code>undo/redo</code> function in my script. I have looked around and see some suggestions, most of them recommended to use <code>command pattern</code>.</p>
<p>The function must work over one page - after a reload of the page the function must able to <code>redo/undo</code> the last things.</p>
<p>I don't know how command pattern works, I think about to create a object, to store the a name of the function, the old and the new value - but I'm not sure if this is a efficient way to do this or not.</p>
<p>Maybe somebody could give me a small example how the code for a <code>undo/redo</code> function should look.</p>
 

Latest posts

B
Replies
0
Views
1
Blundering Ecologist
B
Top