--- title: "Screen Strings" id: 77928 type: "computer_media" slug: "screen-strings" url: "http://localhost/computer_media/screen-strings/" markdown_url: "http://localhost/computer_media/screen-strings.md" published_at: "2026-11-19T15:04:15+00:00" modified_at: "2026-11-19T15:04:15+00:00" featured_image: url: "http://localhost/wp-content/uploads/2026/11/screen-strings-1.png" excerpt: "Copies the ZX81 screen into a 704-character string so it can be redrawn at once with one PRINT." 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: "TS 1500" slug: "ts1500" taxonomy: "post_tag" url: "http://localhost/tag/ts1500/" - 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/" - name: "Timex/Sinclair 1500" slug: "ts-1500" taxonomy: "model" url: "http://localhost/model/ts-1500/" indiv: - name: "Robert Midura" slug: "robert-midura" taxonomy: "indiv" url: "http://localhost/indiv/robert-midura/" genre: - name: "Programming" slug: "programming" taxonomy: "genre" url: "http://localhost/type/programming/" media_type: "Program" programmers: - name: "Robert Midura" slug: "robert-midura" taxonomy: "indiv" url: "http://localhost/indiv/robert-midura/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Screen%20Strings%20%281984%29%28Midura%2C%20Robert%29%28TS1000%29%28US%29%28Program%29.zip" mediadate: "1984" images: - url: "http://localhost/wp-content/uploads/2026/11/screen-strings-1.png" - url: "http://localhost/wp-content/uploads/2026/11/screen-strings-2.png" article_media: - id: 24145 title: "Just for Fun" type: "article" url: "http://localhost/article/just-for-fun-2/" - id: 76866 title: "Screen Strings" type: "article" url: "http://localhost/article/screen-strings/" media_type_tags: "Programming" license: false --- # Screen Strings 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](https://timexsinclair.com/article/just-for-fun-2/)) and reprinted in Sinc-Link July/August 1987 ([Screen Strings](https://timexsinclair.com/article/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 ```