Initializing a global variable from tinydb creates an error... why?

Hello to all !!
I am trying to initialize a global variable from a tinydb and i get an error, but somehow it works. Can anyone explain me why is this happening, and how it can be solved?

Thank you very much.

You can't set a global variable on initialisation by itself with a tinydb value

You have to set the variable in the Screen1.Initialise block

You mean like this...? Because i tried it and its not working...

It has to work and it works. Why should something that works for thousands of people not work for you?

Got something written under this tag?

Nothing to worry... its repositioning tools for placing labels on specific locations on the screen. I store the value on another screen in the tinydb. Do you believe that it has to do with that?


Providing both screens are using the same TinyDB, that cannot be the issue. If you are testing your App with the companion, it is worth deleting the Companions stored files so that you are testing the most recent version of your App with a brand new TinyDb created.

Can you please tell me how to do that? (deleting the Companions stored files) I googled it and i didnt find anything ....

Thanks a lot!!

On your phone, go to Settings, Apps List, MIT AI2 Companion, Storage - clear data. Then run your App again under Companion.

If that does not work, connect your phone to a PC with a USB cable and navigate the folders to the Companion - just delete all files from the Companion folder (you should recognise them when you see them).

1 Like

it says clear data and clear cache memory... which one should i select?

You can clear both :grin:

1 Like

TinyDB is stored in the data section, not the cache. The system can delete files in cache if space is needed, so it wouldn't make sense for permanent data storage.

1 Like