TinyDB with buttons

Can you send me the most recently updated version of your Project (no warnings)
TR4? I will request some help from my fellow Power Users.

TR (4).aia (172.2 KB)
I hope your "teammates" can fix the errors.
Thank you for all

Btn Comenca is not fixed?

I think that yes, but maybe not because I think it's bugged because don't warning me about the errors and with so many blocks it's difficult to see if a block it's duplicated

It wasn't fixed

It's not many Blocks at all (yet), but the reason why I used those "divider blocks" is to find things more easily - All Blocks that belong to a VS grouped together.

Can you post your fixed Project? I'm off for dinner now - starving!

TR (5).aia (172.1 KB)
Bon Appetite

The cause of this error is found in these two places:



The first block is a global variable made up of a list of Text Box component blocks.
In the second block, you are trying to assign component blocks from that list into text attributes.
You are missing the generic blocks to pull text from the selected Textbox components.

Hi ABG

That code is actually applying text to each of the TextBox Components in the list. The text is from a stored list of names.

I guessed wrong, I guess.

That global was the only list of text boxes I saw, and the first loop in that procedure was the only place I found traversing that global.

I have run out of straws to grasp, except for maybe double checking the Companion version.

Here is the strange thing - I templated the original code and it works, no error message. The method looks the same to me in Carles' Project but I'm too familiar with it and can see the error which is mostly like right under my nose.

Edit: - found a code duplication in an 'old' Block.

Hi Carles

Right - in the end, found a few bugs(!), but none of them trigger the error.

So I'm asking my colleagues if any of them recognise this error. I don't think the Project is corrupted but I could be proved wrong. Apart from more text in Spanish, I can't see a difference between the two Projects in the area of the code concerned.

The error occurs when the App should populate the five Player Name Buttons on Virtual Screen2 (VS2). That's the moment after five names out of eleven have been selected on Virtual Screen3 (VS3).

The error says:
For range: the end value -- [
com.google.appinventor.components.runtime.TextBox@5b977d,
com.google.appinventor.components.runtime.TextBox@6d5c672,
com.google.appinventor.components.runtime.TextBox@9a86ac3,
com.google.appinventor.components.runtime.TextBox@30f0f40,
com.google.appinventor.components.runtime.TextBox@f8f2e79,
com.google.appinventor.components.runtime.TextBox@ab5d7be,
com.google.appinventor.components.runtime.TextBox@21cf01f,
com.google.appinventor.components.runtime.TextBox@e75df6c,
com.google.appinventor.components.runtime.TextBox@bcb3935,
com.google.appinventor.components.runtime.TextBox@4f3b1ca,
com.google.appinventor.components.runtime.TextBox@82a6f3b
] -- is not a number

This is the file that generates the error:
TR5_update.aia (171.9 KB)

This is the example file it is based on, that doesn't generate an error:
RecordBasketsVirtual_Update.aia (115.1 KB)

@TIMAI2 @ewpatton @Boban Have you seen this error before? What does it actually mean in layman's terms?

I believe the error is specifically in the procedimientoApplyNomJugadorsSeleccionats, namely:

References the global List_Textbox_VS3_PlayerManager, but for range wants a number. Either switch to using for item in list or get the length of the list instead. For performance reasons, if you need to touch every index in a list you should use the for item in list construct since it will perform better.

2 Likes

Yeah I think that's the only difference between your version and mine


Like this?

That seems to better follow the rest of the code. However, I didn't review everything so there may be other issues.

That was the error. Thank you so much,Chris and ewpatton. I'll put you on my thanks in the research work. Really grateful

Yes :slight_smile:

Carles, work with my corrected version of your Project - it has other bugs removed.

TR6.aia (171.8 KB)