Error message: The operation + cannot accept the arguments "", ""

Hi! Hope you are doing well! I thought that the data was storing until I noticed the error message on my screen. I have included an image of the message bellow. If you could please try to help me once more, that would be great because I desperately need this done by Monday. Thanks you in advance! Here is the image of the error message(I believe the error has occurred because textual value can not be added using the '+' block): Screen Shot 2021-02-11 at 8.44.36 PM

Hi Richael

What the message is saying is it cannot add empty values

empty: [""]

not empty: ["123"]

Is that enough of a clue for you to find the cause of the issue?

App Inventor can simply treat "text numbers" as numbers. To ensure the text consists only of numbers, in the Designer Properties Palette, set the relevant Text Boxes to "numbers only".

NumbersOnly

Use the Do It facility track back unexpected data to its source.

Sorry, but I don't get what you are trying to say, could you kindly elaborate more?

Look for the Do It section at
http://ai2.appinventor.mit.edu/reference/other/testing.html

Read it.

Then try it.

you are trying to add 2 values...
question: what is the result of adding an empty string + another empty string?
-> you only can add numeric values, but not empty strings...
make sure to initialize your textboxes with 0 or check your data before doing any calculation like this

if is empty textbox1.text 
then "please enter a value in textbox 1"
else if is empty textbox2.text 
then "please enter a value in textbox 2"
else do the calculation

use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools
Taifun
PS: I moved your new question to a new thread... please start a new thread for completely new questions... thank you...


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

Hi Chris! I check the Designer Properties Palette and the TextBox is already set to numbers only.

Hey Chris! Now the message says something different, because I realized that I did not fill out the TextBox, but now it is showing that the first value (from the variable) is empty. I even checked the variable and it is set to 0, which I don't think is considered empty. There are some images included below.
Screen Shot 2021-02-14 at 4.33.32 PM

Hey ABG! Could you please take a screenshot to show me where I can locate/find the Do It block?
@Taifun Could you also try to help me with that?

Hi Richael

Set the valueIfNotThere to zero instead of blank text.

Snap1

1 Like

It's not a block.

It's a right click option on each block in the Blocks Editor workspace.

.... when the App is running in the Companion

Hi Chris, it still isn't working and now there is a new error message.
Screen Shot 2021-02-14 at 4.44.49 PM

Hey, ABG! When I right click on the Do It option, it is not available. Screen Shot 2021-02-14 at 4.50.56 PM

Incremental development with the Blocks editor

When you create apps with App Inventor, you are working on the phone live : Drag a button icon to the Viewer and the button appears on the phone right then; change the button's color in the Designer and the color changes; drag out a block that makes something happen when the button is pressed, and you can press the button right then on the phone to see it happen.

This kind of feedback is enormously useful, because it lets you develop and test your apps incrementally, defining each bit of new behavior and testing as you go along. Inexperienced programmers often make the mistake of building a large amount of stuff before they test any of it. Then, when they run into bugs, they're faced with a huge tangle to sort out, where they don't know which pieces are working and which are not. So try to work incrementally. You'll still surely encounter bugs, but incremental development will let you isolate bugs more quickly and fix them more easily.

In addition to letting you try things by interacting with the phone itself, App Inventor includes features to aid in testing and debugging while you are using the Blocks editor. You can see these if you right-click on a block. This will bring up a menu, as shown here for a block that calls the procedure moveMole :

screenshot.png

Not all blocks will offer the same choice in the menu.

Do It

You can perform the action for a block with Do It . In debugging a program like MoleMash, you could select Do It for MoveMole and see if the mole moves on the phone.

Do It not only does the block's action, but also puts up a balloon that shows the value returned. The figure below shows the use of Do It on an addition block to show the result of adding two numbers called this and that. This also acts as a comment block, so you can add comments to the Do It result window.

ss2.png

Result balloons are attached to blocks at a point indicated by a small question mark. You can click on the question mark to hide and show the result. You can also remove the result block and comments completely by right-clicking and choosing Remove Comments.

@ABG Is there any certain section/paragraph/sentence that you need me to look at?

Apparently, you want only fully developed solutions.
NZ

Can you read this?

@ABG Sure, I can read it. Should I do add this code to my app?

If you type up the NZ procedure as shown, and wrap every thing going into each of your math operations with NZ(), it will filter out non-numbers.