--- title: "String Function Translation" id: 76635 type: "computer_media" slug: "string-function-translation" url: "http://localhost/computer_media/string-function-translation/" markdown_url: "http://localhost/computer_media/string-function-translation.md" published_at: "2026-11-11T08:02:15+00:00" modified_at: "2026-11-11T08:02:15+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/string-function-translation-1.png" excerpt: "Shows how to get the effect of other BASICs' LEFT$, RIGHT$, MID$ and TL$ with the ZX81's string slicing." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "ZX81" slug: "zx81" taxonomy: "post_tag" url: "http://localhost/tag/zx81/" model: - name: "Sinclair ZX81" slug: "zx81" taxonomy: "model" url: "http://localhost/model/zx81/" - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Arthur Bumpus" slug: "arthur-bumpus" taxonomy: "indiv" url: "http://localhost/indiv/arthur-bumpus/" genre: - name: "Utility" slug: "utility" taxonomy: "genre" url: "http://localhost/type/utility/" media_type: "Program" programmers: - name: "Arthur Bumpus" slug: "arthur-bumpus" taxonomy: "indiv" url: "http://localhost/indiv/arthur-bumpus/" download_url: "https://archive.org/download/timex-sinclair-software-archive/String%20Function%20Translation%20%281982%29%28Bumpus%2C%20Arthur%29%28TS1000%29%28US%29%28Program%29.zip" mediadate: "1982" images: - url: "http://localhost/wp-content/uploads/2026/11/string-function-translation-1.png" article_media: - id: 19297 title: "String Function Translation for 8K" type: "article" url: "http://localhost/article/string-function-translation-for-8k/" media_type_tags: "Utility" license: false --- # String Function Translation Other BASICs have LEFT$, RIGHT$ and MID$ functions; the ZX81 uses slices like A$(1 TO 3) instead. This program asks for a string four times and prints the result of each translation: the left part, the right part, a middle part, and the string without its first character (the ZX80’s TL$). Use strings longer than seven characters. It ends with PROGRAM COMPLETED. Published in Syntax August 1982 ([String Function Translation for 8K](https://timexsinclair.com/article/string-function-translation-for-8k/)). ## Source Code ``` 10 REM "STRING FUNCTIONS" 20 REM ZX80/8K ROM 30 REM ART BUMPUS 50 REM LEFT$ (A$,N) 60 GOSUB 500 70 LET N=7 80 REM PRINTS UP TO 7TH CHAR. 90 LET B$=A$( TO N) 100 PRINT B$;"""LEFT$(A$,N)""" 110 REM RIGHT$ (A$,N) 120 GOSUB 500 130 LET N=7 140 REM PRINTS FROM 7TH TO END 150 LET B$=A$(N TO ) 160 PRINT B$;"""RIGHT$(A$,N)""" 170 REM MID$ (A$,N1,N2) 180 GOSUB 500 190 LET N1=7 200 LET N2=1 210 LET N3=N1+N2 220 REM PRINTS 1 CHAR. FROM THE 7TH 230 LET B$=A$(N1 TO N3) 240 PRINT B$;"""MID$(A$,N1,N2)""" 250 REM TL$(A$) 260 GOSUB 500 270 LET B$=A$(2 TO ) 280 REM THIS DROPS THE 1ST CHAR. 290 PRINT B$;"""TL$(A$)""" 300 PRINT "PROGRAM COMPLETED" 310 STOP 500 INPUT A$ 510 PRINT A$;"="; 520 RETURN ```