Num function

Returns true (1) if the expression is a number or a numeric string. Otherwise, returns 0.

result = Num(expression)

The Num function has the following parameters.

ParameterDescription
ExpressionIf the expression evaluates to a number, a numeric string value, such as scientific notation, or null, Num returns a value of 1 (true). If the expression evaluates to a letter or alphanumeric string, the result is a 0 (false).

In the following example:


K1 = Num(937)
K2 = Num("673")
K3 = Num("2G8")

the variable identifiers K1 and K2 will each be assigned a value of 1 (true). The variable identifier K3 will be assigned 0 (false). A decimal point in a numeric string will evaluate to 1 (true). Commas or dollar signs cause even an otherwise all numeric string to evaluate as 0 (false). Use Alpha to determine whether the given argument is non-numeric.

Caution: The letter "e" (or "E") within a number evaluates to a number with scientific notation.

if Num(wait_time) then
       Delay(wait_time)
end
  • guides/programming/programmers_reference_manual/num.txt
  • Last modified: 2024/10/14 18:18
  • by 127.0.0.1