Problem in creating quantity increaser/decreaser

Hey I want to make something which increase and decreases the amount of things to be purchased from a particular store, to do the same I added two buttons to increase and decrease the quantity, but I'm not able to figure out how to do this.
Screen image


Shouldn't that be greater than or equal to 1. I presume this is what the problem is.....

1 Like

Stated the same :joy:
Kindly check if your answer has been posted earlier or not!

1 Like

Thanks! I did not observe that >=1 part!!
But when I run this app and press on any of the (+/-) buttons
It says bad arguments given!
this is perhaps because the text box stores info as a string and I want it to store it as numbers(integers)
any way to fix this?

You might be giving the input as a string (App inventor automatically converts numbers in strings to number) see here -

Check for spaces and or charcaters

1 Like

There is no character or space in the text box. when i press + button then it says
Bad arguments to +
The operation + cannot accept the arguments: , [""],[1]

Oh I see! You are trying to click the + button when the textbox is empty. Try setting the default value of the textbox to 0. Then you shouldn't face the error.

1 Like

Yeah it worked thanks!

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