SVasco
(SVasco)
May 15, 2019, 6:12pm
#1
Hi:
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!
Robert
(Robert Crum)
May 15, 2019, 6:15pm
#2
Maybe you only want numbers in textbox…
SVasco
(SVasco)
May 15, 2019, 6:17pm
#3
@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!
cian
(Cian)
May 15, 2019, 6:24pm
#4
What @Robert is saying is use the blue blocks for a comparison . (math)
1 Like
Taifun
May 15, 2019, 9:49pm
#5
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
Taifun
3 Likes
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
Taifun:
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
Kanishka_Developer:
It shouldn’t be
No, this is one of App Inventor’s features.
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