VAL - source-solutions/HELP GitHub Wiki
value = VAL(string)
Returns the numeric value of the string expression string
. See the section on numeric literals for the recognised number formats.
- Spaces before a number are ignored:
VAL(" 10")
returns10
. But unlike Microsoft BASIC, spaces inside a number are not ignored. - Unlike Microsoft BASIC, expressions inside the string expression are also
evaluated. For example,
VAL "5+5"
returns10
andVAL "foo"
returns the value of variablefoo
. - Expressions between curly braces
{
and}
are not evaluated, but their syntax is checked upon entering. They are interpreted as strings that can be passed to VAL for actual evaluation.
string
has a number value: Type mismatch.