Skip to content
Andrew Owen edited this page May 30, 2023 · 1 revision

VAL$


repr = VAL$(string)

Evaluates a string as a string expression. For example

10 INPUT a$, x$ 20 PRINT VAL$ a$

The string value assigned to a$ should be an expression using x$. For example, "x$+x$". A string value is then assigned to x$, for example "yo". VAL$ strips the quotes of the value of a$ to get x$+x$ and evaluates it using the value assigned to x$ displaying the result yoyo.

Notes

  • This function is not present in Microsoft BASIC. It is very useful for creating recursive functions, if used together with AND applied to string arguments, allowing for selective evaluation.
  • 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.

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