It looks like I can't indicate the component as a string, but I have no idea how to do it any other way. Even entering the name of the vertical array "Mission1", it doesn't even let me join the block.
Everything comes because I have made a FOR loop so that depending on the values of the database it shows some arrangements or others depending on the value of the database itself which I initiatite in SCREEN1:
In general, I usually have problems with some blocks and I only find trial-error solutions because I am not able to find detailed information about the elements supported in some blocks. Is there somewhere with detailed documentation?
Excuse my ignorance, I searched the forum and found nothing.
I have erased black text for the list in TinyDB but this is not the problem.
Please, could you explain clelarly how to define a dictionary as you mentinioned. I thought that by defining the TinyDB like this, I was doing something similar to a dictionary
Take into account that the names of the vertical arrangements are the same as the Tiny DB:
I have designed a simplified code, and it still does not work:
I don't understand why I can't do this. So, what is the utility of using this kind of block if you can only enter de exactly name of the component? I have seen the examples above, and it give me this idea.
Sorry for my ignorance.
Could you give another way to solve this situation: switch on and off Vertical Arrangement in order simulate changing screens
I need to store the name of some vertical arrangements becasuse they include other components that compose the the differents stages of a game (that I want to appear in the same screen, not at same time, in order to simply the code)
Additionally I have anther parallel screen with a map of the game. The gamer must be able to return to the main game screen with the same components. Thats the reason I have to store in TinyDB the state of visibility of these vertical arrangements: in order to control their visualitation.
Could you explain the block to get the index of a component?
I have just discovered that if I store the index of the vertical arrangement in tiny db and in another moment get the value and use in this block, I get the mentioned error
On the other hand If I make a simple list storing the intex of the vertical arrangements:
But, as said, I can't store the vertical arrangement's indexes in Tiny DB.
Maybe this is related with the fact that storing in DB the data is converted in a string. So the question is to know what kind of data is spected in "COMPONENT" parámeter in this block,
Thanks Meritcat @TIMAI2 , finally you have explained really well. I didn't understand what other users say to me...
I have no words to thank you for your help. I have wasted a lot of Sunday's hours.
Your solution is really simple and smart: only storing the index of the visible arragement in TinyDB
In any case, I'm curious why storing the list of arrays in a list located in the database didn't work.
However, I am somewhat annoyed with the inflexibility of appinventor: It is true that my level of programming is very basic, but I usually solve problems by writing pseudocode that I later have a hard time bringing to APP INVENTOR because I feel that it has some absurd limitations that lead me to problems whose solution are "video game cheats".
Components like vertical arrangements are created at runtime, when the app initialises, and each component is given a unique name. This unique name can be used in that session of the app, but next time you run the app the components are initialised again with new unique names. Therefore if you attempt to store one of these unique names in a tinydb, it will not exist in the app the next time you run it.
Also, you cannot store strings of component names and expect them to return a component.
I understand what you're saying, but not completely:
In my last trials, what I have saved in the database, is the same that you done in "vaList" : the content of the block of the arrangement that gave me its block as a result: something like "com.google.appinventor.components.runtime.VerticalArrangement@ xxxxxx"
Where xxxx is what changes at every arrangement. So, theorically it should work, becasuse I stored, as you, the unique session name in a list every time the screen initializes
Maybe when it is stored in TinyDB the coding change to a text (string) or something like that (maybe xxxxx is hexadecimal)
Kind regards and I'll read you tomorrow, I go to bed