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

Discussion in 'Android Questions' started by schemer, Feb 6, 2015.

  1. schemer

    schemer Active Member Licensed 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
     
  2. sorex

    sorex Expert Licensed 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)
     
    schemer likes this.
  3. schemer

    schemer Active Member Licensed User

    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.basic4ppc.com/android/help/collections.html#map
     
    Last edited: Feb 6, 2015
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice