[Textbox] Zero "0" number value problem!


I’m trying to detect when a zero “0” is typed in a textbox:

Can be typed any number/letter in textbox!
But, for some reason, when the textbox as a zero “0” it does not detect it!

How can a zero “0” be detected when the user type 0 in it?

Thank you!

Maybe you only want numbers in textbox…

@Robert is a “Decimal number: 8” type!

I need it decimal. Example: 1.25

Problem is, when the user type 0 in the first place, the textbox.text should automatically changed to “0.”
… and for some reason is not working!

What @Robert is saying is use the blue blocks for a comparison . (math)

1 Like

the green = and the blue = blocks are identical… see also the documentation…

@SVasco you might want to try the textbox extension and its AfterTextChagned event


He means @SVasco should use a blue Math block for the 0, and not a Text block which signifies "0". It’s just a case of mixed types.

1 Like

it is the same


It shouldn’t be, but since app inventor has no parseInt functionality, I can see why that is. The question remains, what caused the original problem?

1 Like

No, this is one of App Inventor’s features. :wink:

Thanks to App Inventor, variables and data types are different when compared to other programming languages.

Maybe you know, App Inventor doesn’t care about data types. So "0" is equal to 0, and it doesn’t need to convert it. Content in data is important, the data type is not important much in App Inventor.

By the way, @SVasco can you get the value of textBox by using Companion and “Do It” option? Your blocks are not wrong, but it I don’t know why this is not working.

1 Like

I know, and I utilize it to make syntaxial monsters impossible to create with other languages.

By “It shouldn’t be” I mean what App Inventor does isn’t optimal.

1 Like

Oh, sorry :sweat_smile: