I am up against a wall of knowledge that I am unable to surmount on my own accord. If someone could guide me (as one does a child;), I just might be able to understand that which has eluded me for a week.
I am working on a program designed to display select atmospheric conditions. I have a virtual screen with checkboxes where functions are selected and another virtual screen where data is displayed in the order it was requested. A portion of each screen is shown below.
I can easily select all checkboxes or deselect all checkboxes. I can even save the data the checkboxes have selected, but herein lies my problem. I simply want to save the specific checkboxes selected as an empty set that I can call up and repopulate with current data at a later time but I cannot square that with my means of original function selection, as shown below for Temperature:
What I really, really want to accomplish is to save the checked functions without the previously selected data. In this way, a technician may select five or six conditions s/he uses repeatedly by saving the functions as a list to be called up repeatedly. I don't know if this is possible, given the way I have progressed because I am trying to save checkbox clicks (function selections) as an overlay that will always capture fresh data, not the data found when the box was originally checked. I need a software-based electronic checkbox clicker
I am using the following blocks to select data and create lists but I am not yet adept enough to create a variation on the theme to suit my purposes:
If anyone had the patience and tenacity to get this far - I thank you kindly. If you have an idea of what I should do and how to proceed, I will be grateful.
Assign a TinyDB tag 'CHECKED_FUNCTION_NAMES' to receive the value returned from the the value function checked_function_names whenever one of those check boxes changes.
At startup, retrieve the value from that tag, and walk the list of text values against a list of all checkbox components, initially all unchecked. This would need to be a doubly nested loop, the checkboxes and the text values. That's needed to get all possible matches, text vs checkbox component. When a text value matches the checkbox text, set the checkbox true.
If you need blocks, export something importable into the blocks editor.
OK, bear with me while I attempt to grock this concept. Basically, after I have initially selected some number of checkboxes and then viewed their contents on the display page, I proceed to save the data as I used to, based on the source. This is done with a TinyDB element already. However, upon startup (or clicking the "New Data" button), I run a comparison of an empty list to that saved list, checking anew every checkbox that had content in it from the previous save. In doing so, I copy the functions but use current data when they are displayed.
Am I close???
Also, is your Apples/Bananas/Cherries app showing me something of what you are talking about in the block section? I do not understand the user input section with three checkboxes that can be clicked on/off (but nothing else that I could see on the screen responded).
And, thank you, again, for your guidance here. I'm trying to keep my mind as elastic as possible by wrapping it around your information.
What I have done here is add an extra TinyDB tag/value to hold the profile of what check boxes should be turned on at startup, based on their on/off history in prior runs, as represented by the list of checkbox text values.
I do nothing with any readings associated the check boxes, just the checked/notchecked status.
I used apple/banana/cherry as sample unique text. Don't expect fruit to flow from your phone's USB-C port.
I restricted this sample app to only the minimum required data and actions to illustrate the concept of saving a profile listing the checkboxes that should be turned on at startup, regardless of intention.
OK, I think I am firing on 3 or 4 cylinders now. I am suspicious of the fruit seeing as how my firewire port for my iPhone (4SE;) will not allow charging claiming that moisture was detected in the charging port. Do you know anything about this?
If and when you have a moment, would you please look over the blocks I have provided in a woefully incomplete .ala file?
I saw from your fruity demo that you called data upon initialization but I want to be able to recall at anytime, so I created a button "Return To Saved Functions" to store the data and "Saved Functions" to recall the data.
This doesn't work and I am wondering if the "When Any CheckBox Changed" block needs to somehow surround some of my other code. Obviously, the included blocks are incomplete but I thought that my error is so glaring that this will be enough. If this gives no clue, please ask and I will extract this particular portion of my code into a mini-app and post it, as my ala is kissing 3.4 mb and all of it is necessary (for me;).
If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...
which means in your case post a screenshot of your relevant blocks...
To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.
Button clicks are user requests for action, and the requested action most likely includes a verb like Save or Retrieve, which should be at the front of the button component name.
Thank you for that. In this case, I was thinking of what @ABG said about MS Paint ruining in=mage quality so I interpreted that as a request for the blocks in a more visually appealing form. I will add images shortly, as I have questions about the blocks that I was asking in a line-by-line style.
My problem is that I need to make future function calls based on checked checkboxes that currently hold old data. I cannot seem to comprehend what is needed to make a copy of the checked boxes and use this to re-check the boxes in the future thereby attaining fresh data.
I can do that . . . in the future. I understand the reasoning. I have simply been looking at the suffix and, if it says "click," I am pretty durn certain that I am dealing with a button.
BTW, if there are enough hours in your day, please look at the attached PNG and tell me if i am even close to what is going on in my comments.
I am worried that not being part of, or trying to exist parallel to, "When Any CheckBox Changed" is causing me grief in trying to repopulate the checkboxes from TinyDB.
I did totally miss that. Thank you. I actually thought I was doing the right thing by changing the text attribute to checked, based on my needs. So much for self-initiative.
Thank you so much, I totally missed this communication from you. I intentionally changed the text extension to checked because I got a wild hair and thought I was doing the right thing.
Oh boy, you've got that right. I totally missed the corrections you presented until it was pointed out to me. Now let's see if I can follow your instructional changes. Thank you for your patience with my gaffs!
It wasn't quite that severe a case of ignorance on my part, I simply passed over your correction without having even seen it. @Taifun was kind enough to point out to me that I was chasing shadows in the night again while I am certain you were trying to determine the absolute depths of my ignorance (I ain't stupid but I sure do miss the obvious more often than I would like to admit).
So, like, OMG, dude! My button logic and GUI need some twiddling now but you have tossed me a giant lifeline, as I had been plugging away at this for several days with nothing to show for it. I am most grateful to you, and everyone else here for your knowledge and patience with my desire to learn and create.