Skip to content
Andrew Owen edited this page May 30, 2023 · 2 revisions

VAL


value = VAL(string)

Returns the numeric value of the string expression string. See the section on numeric literals for the recognised number formats.

Notes

  • Spaces before a number are ignored: VAL(" 10") returns 10. 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" returns 10 and VAL "foo" returns the value of variable foo.
  • 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.

Errors

string has a number value: Type mismatch.

Welcome to the SE BASIC wiki


  • Press RETURN to return to this menu.
  • Enter the name of a TOPIC to display it.
  • Enter EXIT to return to BASIC.

Choose from the following topics:

  1. Quick start guide: QUICK
  2. User's guide: USER
  3. Configuration guide: CONFIG
  4. Language guide: LANGUAGE
  5. Language reference: BASIC
  6. Technical reference: TECH
  7. Developer's guide: DEV
  8. Acknowledgemets: CREDITS
  9. Licenses: LICENSE
Clone this wiki locally