how to programme "Undo" and "Redo" in VB6?
Started by
monkey3333sg
, Sep 25 2006 08:46 AM
#1
Posted 25 September 2006 - 08:46 AM
#2
Posted 02 October 2006 - 04:51 PM
Hello,
I am afraid that my knowledge in VB6 is still very rookie'ish but I would expect that the only way to include "Undo" and "Redo" functions would be to somehow store the position of each object on the screen, along with any current variables, into a (possibly large) number of variables.
Whenever an operation (other than Undo/Redo) takes place, all of the objects details should be 'saved' into these variables, so that they can be reverted to in the case of "Undo'ing". Multiple undo's however, are way beyond me, unless using the principle I have suggested is repeated. However, I expect this method could be very memory consuming, as well as far beyond my code knowledge
I am afraid that my knowledge in VB6 is still very rookie'ish but I would expect that the only way to include "Undo" and "Redo" functions would be to somehow store the position of each object on the screen, along with any current variables, into a (possibly large) number of variables.
Whenever an operation (other than Undo/Redo) takes place, all of the objects details should be 'saved' into these variables, so that they can be reverted to in the case of "Undo'ing". Multiple undo's however, are way beyond me, unless using the principle I have suggested is repeated. However, I expect this method could be very memory consuming, as well as far beyond my code knowledge
Chris Wright
Edited by ChrisWright, 02 October 2006 - 04:52 PM.
#3
Posted 10 October 2006 - 01:51 AM
It wouldn't take much memory. I'll explain why:
An average user has 512 MB of ram. Which is 512 Million bytes.
A variable takes an average of 12 characters... If you got 500 variables to save, you store 6000 characters, which is still only 6 KB.
Can anybody notice 6KB out of 512 MB?
How you think Photoshop does it? With about 25 (if I'm not mistaken) possible Undo's.
Well, Chris, your suggestion can and will work, it's just the time that it takes to script it...
Good luck on it Monkey.
An average user has 512 MB of ram. Which is 512 Million bytes.
A variable takes an average of 12 characters... If you got 500 variables to save, you store 6000 characters, which is still only 6 KB.
Can anybody notice 6KB out of 512 MB?
How you think Photoshop does it? With about 25 (if I'm not mistaken) possible Undo's.
Well, Chris, your suggestion can and will work, it's just the time that it takes to script it...
Good luck on it Monkey.
Similar Topics
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users