How do I ask a user to enter a number?
Hello,
Let's say I want the user to enter a number and then assign that number to an attribute. How do I do that? As far as I can tell, the keyboard input behavior only works with text strings and any number entered would only be a text number, not a numerical value that could be compared with another numerical attribute. Or am I wrong about that?
If I'm right that keyboard input won't work for this, what's the best way of doing it?
Thanks,
Eli
Let's say I want the user to enter a number and then assign that number to an attribute. How do I do that? As far as I can tell, the keyboard input behavior only works with text strings and any number entered would only be a text number, not a numerical value that could be compared with another numerical attribute. Or am I wrong about that?
If I'm right that keyboard input won't work for this, what's the best way of doing it?
Thanks,
Eli
Best Answer
-
Photics Posts: 4,172
As far as I can tell, the keyboard input behavior only works with text strings and any number entered would only be a text number, not a numerical value that could be compared with another numerical attribute. Or am I wrong about that?
I just tested it out. I entered a number through the keyboard input and then I used it in an expression. It worked fine. I entered the number "5" and then I multiplied it by 5. Using display text, with the attribute as the text being displayed, I got the number 25.
I used "Real" as the attribute storing the input from the keyboard.
Answers