A short demonstration of storing the whole screen in a string. The subroutine at line 10 reads the display file, skips the end-of-line (NEWLINE) codes and copies the 704 character positions (22 lines of 32) into P$, so the screen can be put back almost at once with a single PRINT P$ instead of a slow FOR-NEXT loop.
The demo starts at line 100: in SLOW mode type RUN 100. It prints TEST PATTERN 22 times at random indents, stores the screen in FAST mode, clears it and stops with report 0/160. Type PRINT P$ to bring the pattern back. Do not RUN it from line 10; the subroutine ends with RETURN. Needs 16K (a full display file). The article notes that TS2068 users must change the 118 in line 50 to 13.
Published in SYNC March/April 1984 (Just for Fun) and reprinted in Sinc-Link July/August 1987 (Screen Strings).
Source Code
10 DIM P$(704)
20 LET X=1
30 LET L=PEEK 16396+256*PEEK 16397+1
40 FOR L=L TO L+725
50 IF PEEK L=118 THEN GOTO 80
60 LET P$(X)=CHR$ PEEK L
70 LET X=X+1
80 NEXT L
90 RETURN
100 FOR I=1 TO 22
110 PRINT TAB INT (RND*20+1);"TEST PATTERN"
120 NEXT I
130 FAST
140 GOSUB 10
150 CLS
160 SLOW
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

