--- title: "VAL$ on Your 2068" type: "article" slug: "val-on-your-2068" url: "http://localhost/article/val-on-your-2068/" markdown_url: "http://localhost/article/val-on-your-2068.md" published_at: "2020-10-27T21:12:32+00:00" modified_at: "2026-08-09T14:22:19+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "To see what VAL$ does, enter: 100 LET a=6: LET b=9 110 LET a$=\"a\"+\"+b\" 200 PRINT 200,VAL a$ 240 PRINT 240,VAL$ \"a$\" 250 PRINT 250,VAL$ \"\"\"a$\"\"\" 260 PRINT 1000 PRINT VAL$ \"\"\"a$\"\"\";\" evaluates to \";VAL$ \"a$\";\" by using theVAL$ function and to \";VAL a$;\" by usingthe VAL funtion.\" RUN the program and see on the…" category: - name: "Syntax" slug: "syntax" taxonomy: "category" url: "http://localhost/category/periodicals/syntax/" post_tag: - name: "Best of Timex/Sinclair 2068 Articles and Documents" slug: "ts2068best" taxonomy: "post_tag" url: "http://localhost/tag/ts2068best/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" basic: - name: "VAL$" slug: "val-2" taxonomy: "basic" url: "http://localhost/basic/val-2/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" publication: "Syntax" publication_r: id: 10246 title: "Syntax" type: "periodical" url: "http://localhost/periodical/syntax/" volume: "5" issue: "10" issues_articles: - id: 26732 title: "Syntax/Syntax ZX80 v5 n10" type: "issue" url: "http://localhost/issue/syntax-syntax-zx80-v5-n10/" pages: "10" pubdate: "October 1984" archive_link: false volumeissue: "v5n10" --- # VAL$ on Your 2068 To see what VAL$ does, enter: ``` 100 LET a=6: LET b=9 110 LET a$="a"+"+b" 200 PRINT 200,VAL a$ 240 PRINT 240,VAL$ "a$" 250 PRINT 250,VAL$ """a$""" 260 PRINT 1000 PRINT VAL$ """a$""";" evaluates to ";VAL$ "a$";" by using theVAL$ function and to ";VAL a$;" by usingthe VAL funtion." ``` RUN the program and see on the display what each function does. You can use this to print both your formula and its number value from a string variable. Succinctly put, VAL$ gives you the string that VAL evaluates, the right-hand side of the equation for A$, by returning some steps earlier. If you have access to a Spectrum manual, you’ll find its explanation clearer than that offered by Timex. This feature demonstrated is one of the subtleties implied by the statement “Sinclair machines always call the expression evaluator”, and plays a role in the sometimes odd report codes that result from failures at intermediate steps.