Switch data between screens doesn't go on all devices

I programmed a money system, where the screen "Game" schauld've transfer the number of coins that you got out of the Game to the screen "Screen3". But it doesn't work on all versions of smartphones on some of them the message The operation + cannot accept the arguments:, ("Coins"), ("0"), what can i do?

blocks(3) ![blocks(2)|690x74]

your error is here

question: why should the valueIfTagNotThere be 0 rather than the text "Coins"?

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Do you mean it so?

no

let's take a look at the documentation
http://ai2.appinventor.mit.edu/reference/components/storage.html#TinyDB

GetValue( tag , valueIfTagNotThere )
Retrieve the value stored under the given tag . If there’s no such tag, then return valueIfTagNotThere .

which means, the valueIfTagNotThere should be 0 in your case, else how do you want to calculate later?

Taifun

I did it now like you said but its still not works for all smartphone versions.

these blocks look ok
what are all these invisible blocks in the screenshot?


what about the other screens?
are you testing the other devices using the companion app or the apk file?

Taifun

The ivisible blocks are disabled blocks. I'am using the companion app, scanning the QR code.
I found an okay solution where the player needs to press an reset button, which resets all tags and sets the coin number to 0, when he plays the app for the first time.

you might want to clear TinyDB and start testing with a fresh TinyDB
Taifun

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.