Description

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

Syntax

result = Num (expression)

Parameters

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.

See also

Alpha()Matches

Examples

if Num(wait_time) then
       Delay(wait_time)
end
  • No labels