Android Question Best parctice for multiple UNDO in a B4A app?

schemer

Active Member
Licensed User
Longtime User
I am guessing a SQLite db may be in the answers and I am currently in learning mode on SQLite, but even in my old VB days I had trouble with multiple undo's and used a module that was open source. It would only allow 1 undo or at least that was all could get out of it. :eek: I have about 12-15 variables that are involved in 1 click of the undo button and wonder how people have a setting that is a user option on how many layers of undo can be performed. I know about the statemanager and keyvaluestore but don't think they are the solution. In a perfect world I would need a maximum of 15 undo's.
Thanks,
schemer
 

sorex

Expert
Licensed User
Longtime User
I think you better use an array, list or map.

with the array you know their positions are in order, the others might be more random.

with the array it's just a matter of having 15 items and when an action occurs you move
the elements from position 1-14 to 0-13 and store the new action at the end (pos. 14)
 
Upvote 0

schemer

Active Member
Licensed User
Longtime User
I think you better use an array, list or map.

with the array you know their positions are in order, the others might be more random.

with the array it's just a matter of having 15 items and when an action occurs you move
the elements from position 1-14 to 0-13 and store the new action at the end (pos. 14)

Sorex,
Thanks for the reply. I never used a map before but have used some arrays and lists for sure. I will do some simple tests and see how I get along. I will search for more info on the map. I did look in my book and all that comes up with in a search is bitmaps. I will keep digging.
Thanks,
schemer

added: I found this so I just need to study some more!
http://www.b4x.com/android/help/collections.html#map
 
Last edited:
Upvote 0
Top