Running in Circles with TinyDB

Greetings,

I have here a fine checkbox display app (thanks @ABG , @TIMAI2 2, et al). I am now trying to educate myself with TinyDB by saving and recalling a database that saves the checkbox order that is displayed below the three buttons. In my dreams, the buttons allow you to save and recall data and return to the data entry page. I would ultimately like to save several TinyDB readings of data.

Could someone direct me to some applicable material that I can wrap my brain around, or show me the error(s) of my code and how to properly expand it to allow several stored datasets? I appreciate any help with this, as I have spent several hours doing noting but digging deep and empty data holes with the TinyDB and List instructionals and I have yet to find myself instructed,(. .

TinyDB_Checklist_Help.aia (103.9 KB)

Your aia did not load to the board.

As I recall, your checkbox order was stored in a simple list of text contents of the selected checkboxes.

So store that list in TinyDB when it's updated, and recall it at app start.

FAQ:

Thank you for that observation. The list was named MyCheckBoxes. I changed a couple of tags but that didn't seem to help. If you have an opportunity to look, I re-uploaded my .ala file and checked to make certain I did so properly. I think I am trying to make this more difficult than it needs to be, but I don;t know where to simplify.

This is the code I added to ONLY save your checkbox list across runs of the app, and to reload the checkboxes at startup.
I also removed code that presumptuously cleared all checkboxes on the way back from viewing data, with the side effect of clearing the saved list.

I used the same tag text as the name of the global list I saved, to avoid confusion.


Notice how the list of checkbox components I traverse is global MyCheckBoxes, specifically set aside for just that purpose. I set the Checked attribute of each checkbox depending on whether or not the checkbox Text is in the list Checkbox_List (which is just the names of the checked boxes, in their order of having been checked.)

This is how I save the global Checkbox_List for the next run, in a procedure where I use the same tag as the prior procedure, hidden away from the fingers of fumblers.

This is the same Cleckbox Changed event as before, except at the very end I always update TinyDB through my new procedure save_Checkbox_List. This way, the saved list is always up to date, regardless of how and who updates the check boxes.

Screen1.Iniitalize is where to call reload procedures. If you already have one, merge their blocks.
blocks (3)

This is the presumptuous button that was clearing checkboxes without permission.
I removed that section.

TinyDB_Checklist_Help (1).aia (104.5 KB)

I did not touch your other code, where you think you are saving data.
I only want to show tested code.
saved the checkbox order