Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to do undo and redo in a grid?
Message
From
11/10/2008 12:33:49
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
10/10/2008 03:46:45
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01353991
Message ID:
01354328
Views:
24
This message has been marked as the solution to the initial question of the thread.
>Hi all!
>I am finding a example codes for undo and redo action with a grids.
>Please give me some information about that!

You can do this with an array of objects, where each object would be a snapshot of the current state of the whole record - done by Scatter Name ... Memo. After each edit (i.e. either a .lostfocus in a control, or a sufficient number of changes in .interactivechange) you could create a new object and add it to the array. Then on ctrl+U you'd restore from the last object in the array, and decrease the pointer. On redo, you'd increase the pointer and restore from the current object. If there were edits after undo, discard any save objects beyond current pointer. When user saves, discard the whole array.

This being a grid, you may need an array of arrays - one array per row. You can also use collections instead of arrays.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform