TinyDB with buttons

The only thing that doesn't work it't that when I begin the app VS1 doesn't appear, appear directly VS3.
In TR6 happens the same and also I get an error of a list

That will be in the Designer Properties - VS3 visible.

In TR6, I get a run time error after selecting the 5 Players

Select list item: Attempt to get item number 1 of a list of length 0: []
Note: You will not see another error reported for 5 seconds.

So there is still a small error in there.

Before you try to chase the problem down, on your phone: settings/Apps/Apps/MIT AI2 companion/Storage you should have a Clear Data button there, which gets rid of all the past App values and TinyDb stored data so you are working with a "clean sheet".

When the VS1 doesn't appear, in my version, i didn't get that error, so probably comes from here

Not sure - nobody ever gets lucky with bugs (unless you really like grey hair)

Don't worry, I'll just take the screen off and that's it if necessary.


Maybe it's something with this blocks, in TR6 there aren't

No no, I removed that - it's replaced by the Start Button :upside_down_face:

Ah okay, so i don't know where the error comes


When I have the same thing twice, VS1 doesn't appear but it runs

Okay now doesn't run, thats for talk hahahaha

image
Okay I think it coul be from here, because how the list it's empty, maybe the programm need something in that list to run

It starts empty and is either filled from TinyDb on App Run, or if TinyDb has no record then the User is taken to the All Players VS3 screen to choose a team of 5 - then the list is stored and the buttons on VS2 also.

My bad.
So what should I do?

Hi Carles

I have been through your code with a fine-tooth comb but not found the problem that triggers the error. I have been off all day today, so a fresh look at it tomorrow (UK time) might find something.

That said, you could just build upon my example file. At least the Blocks are in order and easier to follow! We also know that it's not corrupted, nothing strange happens whereas last night your project gave 68 warnings when I switched from Blocks to Designer and back again. I logged out of AI2, logged back in again - no warnings.

If you choose to move on with my file, test each time you make a change.

RB_Virtual.aia (115.0 KB)

Just testing your project again and it is now saying the list of VS is empty, which of course it is not (nor ever is), so I think there is some file corruption under the hood.

In this version I don't get any error. I'll look my blocks and all the list to see if any list it's bad constructed.
And I don't know if this can work, but if the file it's corrupted, I can copy the project and paste it in another file, or it's a nonsense?

You can indeed copy Components and Blocks :grin:

To other files? Because I know I can copy It between screen, but between projects?

I changed all to other project and I still getting the error. I don't know what to do anymore.
@ABG @ewpatton Any help will be accepted, Thanks.

Hi Carles

Can you post your latest file? Hope this is readable to others, Google Translate is running wild here.

...Depends how you copied things across - possibly the bug went along with it too.

Why not work with RB_Virtual as your base. I have provided template Projects like that for many people (especially for Bluetooth projects).