in BASIC ROM:
|List of all BASIC keywords|
Typ: Numeric Function General Programming-Syntax: VAL(<String>)
The function VAL finds a numerical value in a string. Space chars and the first minus- (-) and plus-char (+) are ignored. The first minus char is interpreted as negative prefix. The searching of the numerical value stopped, when the first non-numerical char is reached. The first dot (.) is interpreted as decimal point and the first e or E as exponent. Mathematical terms and arithmetic operation are ignored.
When the argument isn't a string, appears the BASIC error ?TYPE MISMATCH ERROR IN line. It can be only processed numbers with values from -1e+38 until 1e+38. Then this area is out of range the BASIC error ?OVERFLOW ERROR IN line is viewing. When the argument is absent, it appears a ?SYNTAX ERROR IN line.
PRINT VAL("A1") Screen: 0 PRINT VAL("- 1 2 3 . 2 3 4 e + 23) Screen: -1.23234e+25 PRINT VAL("1051 E-3 -1.051 C) Screen: 1.051