The num() function evaluates an expression and returns 1 (true) if it is a decimal numeric. Otherwise, it returns 0, if the expression contains any nonnumeric characters.
num(exp)
exp | Expression to test. If it is a decimal numeric, 1 (true) is returned. If it contains any nonnumeric characters, 0 is returned. |
The empty, or null string ("") is considered to be a numeric string.
The strings below are considered to be numeric, and return a 1:
. (period)
- (minus)
+ (plus)
-. (minus/period)
+. (plus/period)
This loop terminates when a numeric response is entered for the variable number.
loop input number until num(number) do repeat