ZX81/TS1000/TS2068 2K or more RAM. by Peter McMullin AUG. 85.
After having gotten my feet wet writing some software, it became a challenge to present introductory or instructive text sequences in an interesting way.
I spotted the cover screen for an IBM software package which was a real eyecatcher: each line of text appeared to scroll outwards into place from the centre of the screen. The Sinclair BASIC string-handling features lend themselves well to this sort of thing. A trivial routine like this must (and this one does) fill 3 requirements:
1) Executes quickly enough to achieve a specific (desired) effect.
2) Easily coded in BASIC.
3) Uses very few bytes.
If you use the subroutine in a long BASIC program, put it near the start of the program, where it will execute more quickly.
The listing should be self- explanatory- the text input string A$ must not be longer than 32 characters. An additional benefit is that the routine centres all text on the screen.
Can you see why LINE 100 is necessary? If not, DELETE line 100, then RUN and see what happens with odd-length strings.
Here’s the Listing: have some fun!
5 REM E<X<P<A<N>D>I>N>G TEXT
10 LET LINE=2
20 PRINT AT 0,0;"> ENTER A TEXT STRING <32 CHR$"
30 INPUT A$
40 GOSUB 100
50 GOTO 30
60 REM
70 REM <P<R<I>N>T> SUBROUTINE
80 REM
100 IF LEN A$/2<>INT (LEN A$/2) THEN LET A$=A$+" "
110 LET END=LEN A$
120 LET MID=END/2
130 FOR N=1 TO MID
140 PRINT AT LINE,16-N;A$( TO N)+A$(END+1-N TO END)
150 NEXT N
160 LET LINE=LINE+2
170 RETURN
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.