String Function Translation for 8K

Author(s): Arthur Bumpus
Publication: Syntax
Pub Details: Syntax/Syntax ZX80 v3 n8 (Volume 3, Issue 8)
Date: August 1982
Pages: 18

While using my 8K ROM and manual I took up the exercise on strings that asks you to work out the equivalents of LEFT$, RIGHT$, MID$ and TL$. The result is this demonstration program.


This demo is set up for strings of more than 7 characters, using 7 as the variable each time. Try substituting other numbers. LEFT$, RIGHT$, MID$ and TL$ are functions common to other microcomputers. These conversions will help you translate from other BASICS.–AZ

  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
SYNTACTIC SUM: 33443, 8K

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.