What does [0][*empty-string*] mean in an error message?

465 views
Skip to first unread message

A.

unread,
Jun 6, 2015, 12:48:25 PM6/6/15
to mitappinv...@googlegroups.com
(Note: Steps 1 & 2 are on Screen1 and Steps 3,4 & 5 are on Screen2)

Hello,

I am in the requirement of some SERIOUS help right now as I have run into a massive problem whilst coding. Basically as my screenshot evidence shows (which I have labelled to show the steps the app should take), it doesn't... So in regards to what should happen, I am coding for computers to be reserved in 10 buildings, previously this was done across 11 screens (1 for the main screen and 1 for each building) now however I am condensing this down to one screen for the ten. Therefore as steps 1 and 2 show, the "Building" variable  is used to determine which building is selected on Screen1, this is then stored under the TinyDB tag of "Building". In Screen2, i.e. step 3, the "Building" variable here is left blank (initially) - I had tried to define it using the TinyDB tag straight away, but it showed an error. In step 4 it shows what I want to happen which is basically the "Building" variable is set to the building's name chosen on the previous screen using the "TinyDB" tag and then I should, in theory be free to use this variable to determine other aspects of my code for that specific screen (i.e. how many computers are available/ booked) and so on. And that's where the problem comes, shown in step 5 the message saying it cannot accept the argument... WHAT ARGUMENT?!!? I seriously don't know what to do and this section is vital for me to continue. Please help...

A.

subject edited by Taifun
Forum Evidence IV.png

Taifun

unread,
Jun 6, 2015, 2:14:10 PM6/6/15
to mitappinv...@googlegroups.com
first of all: see the posting guidelines, inappropriate language is not allowed here, I fixed that for you in your post...

please ask politely next time, thank you!.

and then you should try to understand the error message
I marked the relevant parts in yellow for you



you are using the subtraction block (this is your operation)
to be able to use the subtraction block, both values must be numeric, the first value currently is 0, the second value is an empty string, you can't subtract 0 - nothing...
which means, before doing a subtraction, first check, if both values are numeric
hope that helps

Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by Taifun.         


A.

unread,
Jun 6, 2015, 2:45:45 PM6/6/15
to mitappinv...@googlegroups.com
Well in regards to the use of 'offensive' language, what exactly did I use that was deemed 'inappropriate'? 

And in regards to subtraction within my code, in all instances whenever I do subtract stuff (such as variables and stuff as seen in my screenshots) they are always of a numerical value, I'd be an idiot (*sorry*) person of reduced intellectual capabilities were I to I don't know subtract strings. 

So what could be the problem, I really don't know.

And if I have unknowingly offended by doing God knows what, then I'm sorry. 

A,
Forum Evidence IV.png

Taifun

unread,
Jun 6, 2015, 3:26:09 PM6/6/15
to mitappinv...@googlegroups.com
is this a subtraction block? it looks a little bit strange in the screenshot...



as you can see, on first run of the app no value will be found in TinyDB, which means, valueIfTagNotThere will be used, and that value is an empty string, isn't it?

so you have to think about, what should be done on first run of the app?
depending on your logic you probably might want to set valueIfTagNotThere to 0 instead of empty string?

Taifun

A.

unread,
Jun 6, 2015, 3:36:01 PM6/6/15
to mitappinv...@googlegroups.com
Ok, thank you. Let me check.
Reply all
Reply to author
Forward
0 new messages