ProvideX V8.20 > Language Reference > 3. System Functions
490
NUM( ) Function
          Convert String to Value
Formats
NUM(string$[,ERR=stmtref])
Where:
string$
Character string whose value is to be converted to a numeric value.
Numeric in string expression (e.g., "19990317").
stmtref
Program line number or label to transfer control to.
Returns
Numeric value from string.
Description
The NUM( ) function returns the numeric value of a numeric expression in a string
(e.g., 19990317 from "19990317"). The string is evaluated and converted to a
numeric value.
If your given string does not contain a valid numeric value, ProvideX returns an
Error #26: Variable type invalid. Your string expression can include any
number of the following valid characters: 0-9, a space, a comma, an equals sign, or a
dollar sign. You can also include one decimal point along with one sign character
(either '-' or '+').
NUM( ) always ignores the decimal point and thousands separator settings in the
'DP' and 'TH' system parameters.
Examples
A=NUM("1.34") ! Yields 1.34
A=NUM("-1,005.") ! Yields -1005
A=NUM("A",ERR=50) ! On error, transfers to 0050 and sets ERR=26