appinventor is driving me nuts. What I am trying to do is to simply select different elements based on their string name, but appinventor wont let me.
So there are 9 images, which can all be selected. I'd like to create a procedure, that changes their respective image when they are selected. Therefore I would need to pass the button to the procedure, example "butt_1" and change its image from "butt_1_image_1" to "butt_1_image_2" and vice versa.
Same for "butt_2", "butt_3" etc.
Also I would like to iterate through all buttons later on, to find out if they are selected and if so, to add a respective string to a list, that I pass on to another screen with TinyDB. In python I would simply merge two strings and call the variable "butt_" + "number" an incrementing while list. But in appinventor I cannot do this apparently, I can only directly select the variable through the get method, but not through using a merged String in the get method.
There must be some solution for this no? It is very basic
thanks for the quick reply & help this forum is always great! While it has some nice ideas in there, it does not completly solve the problem of repetitive code / copy pasting it.
What I would like to have removed as well is this whole part:
I do not want to have one block for every image. Instead something like the button number, which was passed as an argument to the method, to merge with "image" --> "image1", "image2" etc., so that it is automatically selected and just needs one block.
now it needs one block of repetitive code for every Image, which is rather bothersome and ugly
It might save me a bit of code in this way and it gives me some nice new ideas, but it wont save too much I fear.
For every button there exist two images, the second one of which is the same image with a dark-blue overlay, so that the user can see that he has selected it. Pressing the button once shows the blue image, pressing it again reverses back to the normal image.
The boolean values / wether an image was selected for training will need to be passed on to the next screen when I press "Start exercise" - but this I can solve with a list and a TinyDB. But again, I will need to copy paste a block for every single button to check if it is selected or not