--- title: "Variable Conversions in the ZX80" type: "article" slug: "variable-conversions-in-the-zx80" url: "http://localhost/article/variable-conversions-in-the-zx80/" markdown_url: "http://localhost/article/variable-conversions-in-the-zx80.md" published_at: "2020-10-27T17:18:35+00:00" modified_at: "2024-06-23T00:43:57+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "There are many cases when it is convenient to convert one type of variable to another, such as numeric to string, or string to numeric. In the ZX80 variable conversions from numeric to string are done with the STR$() function. The reverse conversion is not available with the 4K Basic. Given a string variable containing…" category: - name: "SYNC" slug: "sync" taxonomy: "category" url: "http://localhost/category/periodicals/sync/" post_tag: - name: "1981" slug: "year-1981" taxonomy: "post_tag" url: "http://localhost/tag/year-1981/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" - name: "ZX80" slug: "zx80" taxonomy: "post_tag" url: "http://localhost/tag/zx80/" model: - name: "Sinclair ZX80" slug: "zx80" taxonomy: "model" url: "http://localhost/model/zx80/" indiv: - name: "Joseph Sutton" slug: "joseph-sutton" taxonomy: "indiv" url: "http://localhost/indiv/joseph-sutton/" publication: "Sync" publication_r: id: 10243 title: "SYNC" type: "periodical" url: "http://localhost/periodical/sync-magazine/" authors: "Joseph Sutton" volume: "1" issue: "3" issues_articles: - id: 26637 title: "SYNC v1 n3" type: "issue" url: "http://localhost/issue/sync-v1-n3/" pages: "26" pubdate: "May/June 1981" archive_link: false volumeissue: "v1n3" --- # Variable Conversions in the ZX80 There are many cases when it is convenient to convert one type of variable to another, such as numeric to string, or string to numeric. In the ZX80 variable conversions from numeric to string are done with the STR$() function. The reverse conversion is not available with the 4K Basic. Given a string variable containing numbers, the program below looks at each number individually to determine its magnitude.