Definition:
|
atom a = prompt_number(string prompt, sequence range={})
|
Description:
|
Prompt the user to enter a number. The prompt parameter is a string of text that is displayed on the screen.
The range parameter can be a sequence of two values {lower, upper} which determine the range of values
that the user may enter. If a user enters a number that is less than lower or greater than upper, they
will be prompted again. If the range parameter is not supplied or explictly {} as per the default, there
are no restrictions on the number that can be entered and returned by this routine.
|
Comments:
|
If this routine is too simple for your needs, feel free to copy (and ideally rename) it and make your
own more specialized version. You can find the original in builtins\get.e
|
Example 1:
|
age = prompt_number("What is your age? ", {0, 150})
|
Example 2:
|
t = prompt_number("Enter a temperature in Celcius:\n", {})
|
See Also:
|
get,
prompt_string
|