--- title: "TEXTYPE" id: 54546 type: "computer_media" slug: "textype" url: "http://localhost/computer_media/textype/" markdown_url: "http://localhost/computer_media/textype.md" published_at: "2024-06-02T16:47:31+00:00" modified_at: "2026-03-30T21:45:58+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2019/02/20230809-041332.jpg" excerpt: "A full-screen text editor with search-and-replace, justified output, printer support, custom typefaces, and 21 user-defined graphics — all in pure BASIC." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Christopher Nystrom" slug: "christopher-nystrom" taxonomy: "indiv" url: "http://localhost/indiv/christopher-nystrom/" - name: "Mannie Quintero" slug: "mannie-quintero" taxonomy: "indiv" url: "http://localhost/indiv/mannie-quintero/" - name: "Ron Ruegg" slug: "ron-ruegg" taxonomy: "indiv" url: "http://localhost/indiv/ron-ruegg/" genre: - name: "Word Processor" slug: "word-processor" taxonomy: "genre" url: "http://localhost/type/word-processor/" media_contents: - id: 51207 title: "CATS Library Tape 6" type: "computer_media" url: "http://localhost/computer_media/cats-library-tape-6/" media_type: "Program" programmers: - name: "Christopher Nystrom" slug: "christopher-nystrom" taxonomy: "indiv" url: "http://localhost/indiv/christopher-nystrom/" - name: "Ron Ruegg" slug: "ron-ruegg" taxonomy: "indiv" url: "http://localhost/indiv/ron-ruegg/" - name: "Mannie Quintero" slug: "mannie-quintero" taxonomy: "indiv" url: "http://localhost/indiv/mannie-quintero/" mediadate: "198x" images: - url: "http://localhost/wp-content/uploads/2024/06/textype.png" media_type_tags: "Word Processor" --- Textype is a full-featured text editor written in Sinclair BASIC, allowing users to input, edit, save, load, insert, delete, search-and-replace, justify, center, and print text stored in a string array. The text buffer uses a fixed-width 32-character-per-line layout stored in the string variable `t$`, with all editing operations (insert, delete, copy blocks) performed via a series of subroutines at lines 9200–9580 that copy data in 704-byte chunks to avoid string memory fragmentation. A cursor-based full-screen editor (lines 20–420) supports page up/down, cursor movement in all four directions, and a type-over mode, using `INKEY$` polling for input. The program includes a SETYP typeface-selection routine (lines 4608–4624) that POKEs machine code into high RAM to switch between regular, bold, modern, and italic printer output styles. A set of 21 user-defined graphics (UDGs) covering box-drawing characters, arrows, and mathematical fraction symbols is defined via DATA blocks at lines 9778–9818. *** ## Program Analysis ### Program Structure Textype is organized as a menu-driven application with a central dispatch loop at lines 720–890 and numbered functional blocks separated by REM headers. Initialization occurs at lines 9830–9920, which set border/paper/ink colors, call the UDG loader subroutine, dimension the text buffer `t$(1)`, set the default column width `w=32`, and POKE the keyboard repeat rate before jumping to the menu at line 735. | Line Range | Function | | --- | --- | | 20–420 | Full-screen cursor editor | | 720–890 | Main menu display and dispatch | | 900–990 | Input text (appends to `t$`) | | 1000–1160 | Save text to tape | | 2000–2080 | Load text from tape | | 3000–3330 | Insert text / load-and-insert | | 3500–3510 | Type-over mode entry | | 4000–4170 | Delete text | | 4500–4510 | Set column width | | 4601–4624 | SETYP printer typeface selector (machine code) | | 5000–5250 | Text justification | | 5500–5730 | Center text | | 6000–6580 | Search and replace | | 7000–7750 | Text output (screen/printer, single/double width) | | 8000–8070 | Clear text buffer | | 8500–8620 | Change border/paper colors | | 9000–9040 | Quick Note (direct LPRINT) | | 9100–9120 | Subroutine: clear lower screen bar | | 9200–9580 | Buffer manipulation subroutines (copy/insert/delete) | | 9600–9650 | Subroutine: print screen page | | 9700–9760 | Subroutine: load UDG data | | 9778–9818 | UDG DATA blocks (21 graphics) | | 9940–9990 | Save program to tape and verify | ### Text Buffer Management All text is held in a single string array `t$` dimensioned as a fixed multiple of 32 characters. This means the buffer is always padded to a 32-column grid, and operations like cursor movement, page-up/down, and justification rely on integer arithmetic rather than parsing newlines. Because Sinclair BASIC’s string slicing is zero-copy and assignment can be slow on large strings, all insert and delete operations use an intermediate buffer `u$` and copy data in 704-byte chunks (22 rows × 32 columns = one screen page). This chunked copy pattern appears in subroutines at lines 9200, 9300, 9400, 9500, and 9510. ### Cursor Editor (Lines 20–420) The full-screen editor tracks screen position with `x1` (row) and `x2` (column), and buffer position with `s`. Control characters captured via `INKEY$` dispatch movement: - `CHR$ 8` — cursor left - `CHR$ 9` — cursor right - `CHR$ 10` — cursor down - `CHR$ 11` — cursor up - `CHR$ 4` — page down - `CHR$ 5` — page up - `CHR$ 13` — Enter (mark selection point) - `CHR$ 226` — return to main menu The cursor is rendered using `FLASH 1` at line 50. At screen edges the cursor wraps: moving left past column 0 jumps to column 31 of the previous row; moving right past column 31 wraps to column 0 of the next row. Page scrolling calls subroutine 9600 to redraw the 704-character window. The variable `a` holds the buffer offset of the top-left character on screen, and `b` is computed as `a+703` for the last visible character. The Enter key at line 380 implements a dual-purpose selection marker: the first press records `d1` (start), the second records `d2` (end). In “Type Over” mode (when `s$` is `"b"` or `"B"`), any printable key at line 110 directly overwrites `t$(s)`. ### Machine Code — SETYP Typeface Module Lines 4608–4624 implement the SETYP printer typeface selection routine originally by RRRuegg. Line 4608 sets up variables and clears memory to make room at address `torg*256` (i.e., 255×256 = 65280). Lines 4609–4611 load 80 bytes of machine code via `READ`/`POKE` into that area. The `DATA` at line 4611 contains a string literal `torg-3` inline among numeric bytes, which is a bug: the BASIC interpreter will attempt to evaluate it as an expression rather than an address offset. Lines 4601–4604 define `RETURN`-terminated stubs that set a `typ` variable and POKE the printer driver system variables at 23618–23620 before calling `RANDOMIZE USR` to invoke the machine code. The four style entry points are assigned to variables `reg`, `bld`, `mod`, `ital` (and uppercase equivalents) so the user can issue `GO SUB reg` etc. after returning to normal editing. ### User-Defined Graphics The UDG loader at lines 9700–9760 iterates over UDG character codes 144–164 (UDGs \a through \u), reading 8 bytes per character from the DATA statements and POKEing them to `USR CHR$ i + j`. There is a bug here: `POKE USR CHR$ i+j,a` uses operator precedence to compute `USR (CHR$ i) + j`, not `USR (CHR$ (i+j))`, so only the first byte of each character is written to the correct address and subsequent bytes are written to consecutive memory locations — which may still produce the intended result by coincidence since `USR CHR$ i` returns the base address of UDG `i` and adding `j` gives the correct offset. The 21 UDGs defined are: - \a — Box outline - \b — Filled circle/spot - \c — Star - \d — Horizontal bar - \e — Vertical bar - \f–\i — Box corners (top-left, top-right, bottom-left, bottom-right) - \j, \l — Left and right arrows - \k — Down arrow - \m–\n — Subscript digits 2 and 3 - \o — Subscript 4 - \p–\q — Superscript digits 2 and 3 - \r — Superscript 4 - \s, \t, \u — Fractions ½, ⅓, ¼ ### Justification Algorithm The justification routine at lines 5000–5250 operates on fixed-width 32-character (or `w`-character) rows already in `t$`. For each row boundary it checks whether the last character is a space and the next row starts with a non-space, indicating a mid-word wrap point. It then inserts spaces between words by shifting characters rightward from the end of the line, repeating with increasing gap sizes (`d`) until the row is filled or no more spaces can be inserted. Output is printed directly to the screen, checking `PEEK 23689` to clear between pages. ### Search and Replace The search subroutine at lines 6500–6580 is called iteratively by the replace loop at lines 6000–6150. It advances a pointer `s2` through `t$` one character at a time, printing each character as it passes (providing a visible “scanning” effect), and returns when a match for `b$` is found or sets `d=1` when the end of the string is reached. On a match, the replace loop uses the buffer manipulation subroutines to resize `t$` and write `a$` in place of `b$`. ### Screen Output and Printer Support Text output at lines 7000–7750 supports four modes: plain screen display, normal-width LPRINT, double-width LPRINT (alternating odd/even rows), and SCREEN$ interleave (loading graphic screens from tape between text segments, copying each to the printer). The variable `ds` controls double-spacing. The subroutine at lines 7500–7570 handles measured output, printing `w`-character chunks via LPRINT with optional blank lines. ### Notable Bugs and Anomalies - Line 185 uses `LET a=b+1` to advance the screen window on cursor-down scroll, but `b` is set by subroutine 9600 and may not be initialized before the first call — however, line 30 calls 9600 on startup so `b` is available. - Line 890, `GO TO VAL s$*1000`, evaluates `VAL s$ * 1000` to jump to lines 1000–9000 for menu digits 1–9, using the `VAL`-in-GO-TO memory optimization idiom. - Line 4611 includes `torg-3` as a string literal in a DATA statement meant to supply numeric machine code bytes; this will cause a type mismatch error when that DATA item is READ into a numeric variable. - Line 3020 calls `GO SUB 20` (the editor loop entry), but line 20 is a REM — execution would fall through to line 25 and then the editor’s initialization, which appears to be the intent. - Lines 9220–9270 copy `t$` into `u$` in 704-byte chunks, but the loop variable `i` is left at its terminal value and reused at line 9400 (`FOR i=i TO LEN v$`), which is intentional but fragile. ## Source Code ``` 1 REM TEXT EDITOR 2000 version 2.2 by C.Nystrom 1985 with SETYPEby RRRuegg all public domain. 2 REM Meld by M Quintero 1985 10 REM \''\''\''\''\''\''\''\''\''\''\''\''\''\''\''\'' EDITOR 20 LET d1=0 25 LET a=1 30 GO SUB 9600 35 LET x1=0 40 LET x2=0 45 LET s=1 50 PRINT AT x1,x2; FLASH 1; t$(s) 55 LET a$=INKEY$ 60 IF a$="" THEN GO TO 55 65 IF a$=CHR$ 4 THEN GO TO 320 70 IF a$=CHR$ 5 THEN GO TO 350 75 IF a$=CHR$ 8 THEN GO TO 125 80 IF a$=CHR$ 9 THEN GO TO 275 85 IF a$=CHR$ 10 THEN GO TO 170 90 IF a$=CHR$ 11 THEN GO TO 220 95 IF a$=CHR$ 13 THEN GO TO 380 100 IF a$=CHR$ 226 THEN GO TO 720 105 IF s$<>"b" AND s$<>"B" THEN GO TO 55 110 LET t$(s)=a$ 115 GO TO 275 120 REM \''\''\''\''\''\''\''\''\''\''\''\'' Cursor Left 125 PRINT AT x1,x2;t$(s) 130 IF s=1 THEN GO TO 50 135 IF x2>0 THEN GO TO 150 140 LET s=s+32 145 LET x2=32 150 LET x2=x2-1 155 LET s=s-1 160 GO TO 50 165 REM \''\''\''\''\''\''\''\''\''\''\'' Cursor Down 170 PRINT AT x1,x2;t$(s) 175 IF s+32>LEN t$ THEN GO TO 50 180 IF x1<21 THEN GO TO 200 185 LET a=b+1 190 GO SUB 9600 195 LET x1=-1 200 LET x1=x1+1 205 LET s=s+32 210 GO TO 50 215 REM \''\''\''\''\''\''\''\''\''\'' Cursor Up 220 PRINT AT x1,x2;t$(s) 225 IF s<32 THEN GO TO 50 230 IF x1>0 THEN GO TO 255 235 LET a=a-704 240 IF a<1 THEN LET a=1 245 GO SUB 9600 250 LET x1=22 255 LET x1=x1-1 260 LET s=s-32 265 GO TO 50 270 REM \''\''\''\''\''\''\''\''\''\'' Cursor Right 275 PRINT AT x1,x2;t$(s) 280 IF s=LEN t$ THEN GO TO 50 285 IF x2<31 THEN GO TO 300 290 LET s=s-32 295 LET x2=x2-32 300 LET x2=x2+1 305 LET s=s+1 310 GO TO 50 315 REM \''\''\''\''\''\''\''\''\''\''\''\'' Page Down 320 IF s+704>LEN t$ THEN GO TO 50 325 LET a=b+1 330 GO SUB 9600 335 LET s=s+704 340 GO TO 50 345 REM \''\''\''\''\''\''\''\''\''\''\''\'' Page Up 350 IF s-704<1 THEN GO TO 50 355 LET a=a-704 360 GO SUB 9600 365 LET s=s-704 370 GO TO 50 375 REM \''\''\''\''\''\''\''\''\''\''\''\''\''\'' Enter 380 IF s$="B" OR s$="b" THEN GO TO 720 385 PRINT AT x1,x2; INVERSE 1; "*" 390 IF d1>0 THEN GO TO 410 395 LET d1=s 400 IF s$<>"4" THEN RETURN 405 GO TO 280 410 IF sCHR$ 58 THEN GO TO 720 870 BEEP .08,5 880 IF s$="0" THEN GO TO 900 890 GO TO VAL s$*1000 895 REM \''\''\''\''\''\''\''\''\''\''\''\'' INPUT TEXT 900 IF LEN t$>11040 THEN GO TO 1500 905 LET b$="" 910 IF LEN t$<64 THEN GO TO 920 915 LET b$=t$(LEN t$-63 TO LEN t$) 920 INPUT AT 21,0;"------------------------------- INPUT TEXT";AT 0,0;(b$); LINE a$ 925 IF a$="" THEN GO TO 800 930 IF t$=" " THEN GO TO 965 935 GO SUB 9200 940 LET d1=LEN u$+1 945 GO SUB 9300 950 LET t$(d1 TO d1+LEN a$-1)=a$ 955 DIM u$(1) 960 GO TO 985 965 LET d=INT (LEN a$/32-.01)+1 970 DIM t$(d*32) 975 LET t$=a$ 985 BEEP .1,7 990 GO TO 900 995 REM \''\''\''\''\''\''\''\''\''\''\''\''\'' SAVE TEXT 1000 INPUT "-------------------------------- Name of Text: ";n$ 1010 IF n$=CHR$ 226 OR n$="" THEN GO TO 800 1020 IF LEN n$>10 THEN LET n$=n$( TO 10) 1030 GO SUB 9100 1040 PRINT #1;AT 1,5;"SAVING AS: ";n$ 1050 SAVE n$ DATA t$() 1060 BEEP .1,10 1070 GO SUB 9100 1080 PRINT #1;AT 1,7;"VERIFY SAVE Y/N)"; FLASH 1;"?" 1090 PAUSE 0 1100 LET a$=INKEY$ 1110 IF a$="N" OR a$="n" THEN GO TO 1150 1120 GO SUB 9100 1130 PRINT #1;AT 1,5;"VERIFYING : ";n$ 1140 VERIFY n$ DATA t$() 1150 BEEP .1,7 1160 GO TO 800 1490 REM \''\''\''\''\''\''\''\''\''\''\''\''\''\'' Full File 1500 PRINT AT 7,9;"TEXT FILE FULL" 1510 PRINT AT 9,10;"SAVE TO TAPE" 1520 BEEP .1,7 1530 GO TO 800 1990 REM \''\''\''\''\''\''\''\''\''\''\''\''\'' LOAD TEXT 2000 INPUT "------------------------------ Name of Text; ";n$ 2010 IF n$=CHR$ 226 THEN GO TO 800 2020 IF LEN n$>10 THEN LET n$=n$( TO 10) 2030 GO SUB 9100 2040 PRINT #1;AT 1,0;" LOADING: ";n$ 2050 DIM t$(1) 2060 LOAD n$ DATA t$() 2070 BEEP .1,7 2080 GO TO 800 2990 REM \''\''\''\''\''\''\''\''\''\''\'' INSERT TEXT 3000 LET b$="INSERT TEXT" 3010 GO SUB 20 3020 CLS 3030 GO SUB 9100 3040 PRINT #1;AT 1,2;"TEXT NEED TO BE LOADED (Y/N)"; FLASH 1;"?" 3050 PAUSE 0 3060 LET a$=INKEY$ 3070 IF a$="Y" OR a$="y" THEN GO TO 3200 3080 INPUT AT 21,0;"------------------------------ INSERT TEXT";AT 0,0; LINE a$ 3100 IF a$="" THEN GO TO 800 3110 GO SUB 9200 3120 GO SUB 9300 3130 LET t$(d1 TO d1+LEN a$-1)=a$ 3140 GO SUB 9500 3150 GO TO 7030 3190 REM \''\''\''\''\''\''\''\''\''\''\''\'' Load Insert 3200 INPUT "------------------------------- Name of Text: ";n$ 3210 IF n$=CHR$ 226 THEN GO TO 800 3220 IF LEN n$>10 THEN LET n$=n$( TO 10) 3230 GO SUB 9100 3240 PRINT #1;AT 1,6;"LOADING: ";n$ 3250 LOAD n$ DATA v$() 3260 BEEP .1,10 3270 LET d=INT (LEN v$/32-.01)+1 3280 GO SUB 9210 3290 GO SUB 9300 3300 GO SUB 9400 3310 LET n=d1-1+LEN v$ 3320 GO SUB 9510 3330 GO TO 7030 3490 REM \''\''\''\''\''\''\''\''\''\''\''\''\'' TYPE OVER 3500 LET b$="TYPE OVER" 3510 GO TO 25 3990 REM \''\''\''\''\''\''\''\''\''\'' DELETE TEXT 4000 LET b$="DELETE TEXT" 4010 GO SUB 20 4020 CLS 4030 IF d1=1 AND d2=LEN t$ THEN GO TO 8050 4040 LET d=-(INT ((d2-d1+1)/32)) 4050 GO SUB 9210 4060 GO SUB 9300 4070 LET n=d1-1 4075 LET d=d1 4080 LET d1=d2+1 4090 GO SUB 9510 4100 GO SUB 9100 4105 LET d1=d 4110 PRINT #1;AT 1,0;" INSERT AT SAME PLACE (Y/N) "; FLASH 1;"?" 4120 PAUSE 0 4130 LET a$=INKEY$ 4140 CLS 4150 IF a$="Y" OR a$="y" THEN GO TO 3030 4160 DIM u$(1) 4170 GO TO 7030 4490 REM \''\''\''\''\''\''\''\''\''\''\'' Change Width 4500 INPUT "------------------------------- NUMBER OF COLUMNS:";w 4510 GO TO 800 4601 POKE 23607,60: RETURN 4602 LET typ=2: POKE 23618,252: POKE 23619,17: POKE 23620,2 4603 LET typ=1: POKE 23618,252: POKE 23619,17: POKE 23620,2 4604 LET typ=0: RANDOMIZE USR (torg*256+2-typ): POKE 23607,torg-4: RETURN 4608 POKE 23562,1: LET torg=255: CLEAR (256*torg-769): LET torg=255: LET reg=4601: LET bld=4602: LET mod=4603: LET ital=4604: LET REG=4601: LET BLD=4602: LET MOD=4603: LET ITAL=4604 4609 FOR i=0 TO 79: READ k: POKE (i+256*torg),k: NEXT i 4610 DATA 0,0,121,203,39,203,39,50,21,255,33,0,61,17,0,torg-3 4611 DATA 1,0,3,126,24,48,203,63,24,44,230,112,24,37,121,230,7,203,39,50,40,255,126,24,30,24,28,24,16,24,14,24,14,24,20,24,18,24,2,203,63,203,63,24,10,203,39,203,39,24,4,183,203,39,182,18,35,19,11,120,177,32,196,201 4612 RESTORE 4610: BORDER 6: PAPER 6: INK 9: CLS : POKE 23607,60 4613 PRINT AT 0,1;"Choose one of four type styles";'TAB 12;"Regular"'' 4614 GO SUB bld 4615 PRINT TAB 12;"Bold"'' 4616 GO SUB mod 4617 PRINT TAB 12;"Modern"'' 4618 GO SUB ital 4619 PRINT TAB 12;"Italics"'' 4620 GO SUB reg 4621 PRINT TAB 4;"To choose type style after";TAB 4;"exiting from screen"'';TAB 6;"Press GOSUB REG";TAB 9;"or GOSUB BLD";TAB 9;"or GOSUB MOD";TAB 9;"or GOSUB ITAL"''TAB 2;"Press C to copy this screen"''TAB 2;"Press n to exit"''TAB 2;"After selecting type,GOTO 9830 for MENU" 4622 IF INKEY$="" THEN GO TO 4622 4623 IF INKEY$="C" OR INKEY$="c" THEN COPY 4624 CLS : PAUSE 30 4990 REM \''\''\''\''\''\''\''\''\''\''\'' JUSTIFICATION 5000 IF t$="" THEN RETURN 5010 FOR i=1 TO INT (LEN t$/w-.01) 5020 IF t$(i*w)<>" " THEN GO TO 5190 5030 IF t$(i*w+1)=" " THEN GO TO 5190 5040 FOR j=0 TO 10 5050 IF t$(i*w-j)<>" " THEN GO TO 5080 5060 NEXT j 5070 GO TO 5190 5080 LET d=2 5090 FOR j=3 TO w 5100 IF t$((i-1)*w+j)<>" " THEN GO TO 5160 5110 FOR k=0 TO w-j-1 5120 LET t$(i*w-k)=t$(i*w-k-1) 5130 NEXT k 5140 IF t$(i*w)<>" " THEN GO TO 5190 5150 LET j=j+d 5160 NEXT j 5170 LET d=d+1 5180 GO TO 5090 5190 IF PEEK 23689=2 THEN CLS 5200 PRINT t$((i-1)*w+1 TO i*w) 5210 NEXT i 5220 IF PEEK 23689=2 THEN CLS 5230 PRINT t$((i-1)*w+1 TO ) 5240 BEEP .1,7 5250 GO TO 800 5490 REM \''\''\''\''\''\''\''\''\''CENTER TEXT 5500 LET b$="CENTER TEXT" 5510 GO SUB 20 5520 CLS 5530 LET s1=0 5540 FOR i=d1 TO d1+w-1 5550 IF t$(i)<>" " THEN GO TO 5590 5560 LET s1=s1+1 5570 NEXT i 5590 IF s1=w THEN GO TO 800 5600 LET s2=0 5610 FOR i=d1+w-1 TO d1 STEP -1 5620 IF t$(i)<>" " THEN GO TO 5650 5630 LET s2=s2+1 5640 NEXT i 5650 IF s1=s2 THEN GO TO 800 5660 LET s2=w-s2-1 5670 LET b$=t$(d1+s1 TO d1+s2) 5680 FOR i=d1 TO d1+w-1 5690 LET t$(i)=" " 5700 NEXT i 5710 LET s=(w/2)-(LEN b$/2) 5720 LET t$(d1+s TO d1+s+LEN b$)=b$ 5730 GO TO 7030 5990 REM \''\''\''\''\'' SEARCH AND REPLACE 6000 INPUT AT 21,0;"-------------------------------- INPUT FIRST STRING";AT 0,0; LINE b$ 6010 IF b$="" THEN GO TO 800 6020 INPUT AT 21,0;"-------------------------------- INPUT SECOND STRING";AT 0,0; LINE a$ 6030 LET d=0 6040 LET s2=0 6050 GO SUB 6500 6060 IF d=1 THEN GO TO 6200 6070 LET d=INT ((LEN a$-LEN b$)/32-.01)+1 6080 GO SUB 9210 6090 LET d1=s2 6100 GO SUB 9300 6110 LET t$(d1 TO d1+LEN a$-1)=a$ 6120 LET n=d1-1+LEN a$ 6130 LET d1=d1+LEN b$ 6140 GO SUB 9510 6150 GO TO 6050 6200 IF PEEK 23688=2 AND PEEK 23689=3 THEN CLS 6210 PRINT t$(s2 TO ) 6220 BEEP .1,7 6230 GO TO 800 6490 REM \''\''\''\''\''\''\''\''\''\''\''\''\''\'' SEARCH 6500 LET s2=s2+1 6510 IF s2=1 THEN GO TO 6540 6520 IF PEEK 23688=2 AND PEEK 23689=3 THEN CLS 6530 PRINT t$(s2-1); 6540 IF s2+LEN b$-1>LEN t$ THEN GO TO 6570 6550 IF t$(s2 TO s2+LEN b$-1)=b$ THEN RETURN 6560 GO TO 6500 6570 LET d=1 6580 RETURN 6990 REM \''\''\''\''\''\''\''\''\''\''\'' TEXT OUTPUT 7000 GO SUB 9100 7005 PRINT #1;AT 1,5;"TO THE PRINTER Y/N)"; FLASH 1;"?" 7010 PAUSE 0 7015 LET a$=INKEY$ 7020 CLS 7025 IF a$="Y" OR a$="y" THEN GO TO 7100 7030 FOR i=1 TO LEN t$ STEP 704 7035 CLS 7040 IF i+703<=LEN t$ THEN GO TO 7055 7045 PRINT t$(i TO ) 7050 GO TO 800 7055 PRINT t$(i TO i+703) 7060 GO SUB 9100 7065 PRINT #1;AT 1,8;"NEXT PAGE (Y/N)"; FLASH 1;"?" 7070 PAUSE 0 7075 LET a$=INKEY$ 7080 BEEP .1,7 7085 IF a$="N" OR a$="n" THEN GO TO 800 7090 NEXT i 7095 GO TO 800 7100 GO SUB 9100 7110 PRINT #1;AT 1,7;"DOUBLE SPACE (Y/N)"; FLASH 1;"?" 7120 LET ds=0 7130 PAUSE 0 7140 LET a$=INKEY$ 7150 IF a$="Y" OR a$="y" THEN LET ds=1 7160 GO SUB 9100 7170 PRINT #1;AT 1,7;"DOUBLE WIDTH (Y/N)"; FLASH 1;"?" 7180 PAUSE 0 7190 LET a$=INKEY$ 7195 CLS 7200 IF a$="Y" OR a$="y" THEN GO TO 7600 7210 GO SUB 9100 7220 PRINT #1;AT 1,4;"ARE THERE SCREENS (Y/N)"; FLASH 1;"?" 7230 PAUSE 0 7240 LET a$=INKEY$ 7245 CLS 7250 IF a$="Y" OR a$="y" THEN GO TO 7330 7260 IF w<>32 OR ds=1 THEN GO TO 7290 7270 PRINT #3;t$ 7275 BEEP .1,7 7280 GO TO 800 7290 LET s1=1 7300 LET s2=LEN t$ 7305 GO SUB 7500 7310 BEEP .1,7 7315 GO TO 800 7320 REM \''\''\''\''\''\''\''\''\'' SCREEN$ Output 7330 LET b$="SCR$" 7340 LET s2=0 7350 LET d=0 7355 LET s1=s2 7360 IF s1=0 THEN LET s1=1 7365 GO SUB 6500 7370 IF d=1 THEN LET s2=LEN t$ 7375 IF d<>1 THEN LET s2=s2-1 7377 IF s2<=0 THEN GO TO 7400 7380 IF w=32 AND ds=0 THEN LPRINT t$(s1 TO s2) 7390 IF w<>32 OR ds=1 THEN GO SUB 7500 7400 IF d=1 THEN GO TO 7310 7405 GO SUB 9100 7410 PRINT #1;AT 1,8; FLASH 1;"START THE TAPE" 7430 LOAD ""SCREEN$ 7450 PRINT #1;AT 1,7; FLASH 1;"STOP THE TAPE" 7460 COPY 7470 CLS 7480 LET s2=s2+5 7490 GO TO 7355 7495 REM \''\''\''\''\''\''\''\''\'' Measured Output 7500 IF s1+w-1>=s2 THEN GO TO 7550 7510 LPRINT t$(s1 TO s1+w-1) 7520 IF ds=1 THEN LPRINT 7530 LET s1=s1+w 7540 GO TO 7500 7550 LPRINT t$(s1 TO s2) 7560 IF ds=1 THEN LPRINT 7570 RETURN 7590 REM \''\''\''\''\''\''\''\''\''\'' Double Width 7600 LET f=0 7610 LET s1=1 7620 IF s1+w-1>=LEN t$ THEN GO TO 7680 7630 LPRINT t$(s1 TO s1+w-1) 7640 IF ds=1 THEN LPRINT 7650 LET s1=s1+(w*2) 7660 IF s1>LEN t$ THEN GO TO 7700 7670 GO TO 7620 7680 LPRINT t$(s1 TO LEN t$) 7690 IF ds=1 THEN LPRINT 7700 IF f=1 THEN GO TO 7310 7710 LET f=1 7720 LPRINT 7730 LPRINT 7740 LET s1=w+1 7750 GO TO 7620 7990 REM \''\''\''\''\''\''\''\''\''\''\''\'' CLEAR TEXT 8000 PRINT #1;AT 0,0;"--------------------------------" 8010 PRINT #1;AT 1,6;"ARE YOU SURE (Y/N)"; FLASH 1;"?" 8020 PAUSE 0 8030 LET a$=INKEY$ 8040 IF a$<>"Y" AND a$<>"y" THEN GO TO 800 8050 DIM t$(1) 8060 PRINT AT 9,10;"TEXT CLEARED" 8070 GO TO 800 8490 REM \''\''\''\''\''\''\''\''\'' CHANGE COLORS 8500 GO SUB 9100 8510 PRINT #1;AT 1,5;"BORDER COLOR (0-7)"; FLASH 1;"?" 8520 PAUSE 0 8530 LET a$=INKEY$ 8540 IF a$CHR$ 56 THEN GO TO 8500 8550 GO SUB 9100 8560 PRINT #1;AT 1,5;"PAPER COLOR (0-7)"; FLASH 1;"?" 8570 PAUSE 0 8580 LET b$=INKEY$ 8590 IF b$CHR$ 56 THEN GO TO 8550 8600 BORDER VAL a$: PAPER VAL b$: INK 9: CLS 8610 BEEP .1,7 8620 GO TO 800 8990 REM \''\''\''\''\''\''\''\''\''\''\''\'' QUICK NOTE 9000 INPUT AT 21,0;"-------------------------------- QUICK NOTE";AT 0,0; LINE a$ 9010 IF a$="" THEN GO TO 800 9020 PRINT #3;a$ 9030 BEEP .1,7 9040 GO TO 9000 9090 REM \''\''\''\''\''\''\''\''\''\''\''\''\''\'' CLS BOTTOM 9100 PRINT #1;AT 0,0;"--------------------------------" 9110 PRINT #1;AT 1,0;" " 9120 RETURN 9190 REM \''\''\''\''\''\''\''\''\''\''\''\''\''\'' CLEAR t$ 9200 LET d=INT (LEN a$/32-.01)+1 9210 DIM u$(LEN t$) 9220 FOR i=1 TO LEN u$ STEP 704 9230 IF i+703>LEN u$ THEN GO TO 9260 9240 LET u$(i TO i+703)=t$(i TO i+703) 9250 GO TO 9270 9260 LET u$(i TO )=t$(i TO ) 9270 NEXT i 9280 DIM t$(LEN u$+d*32) 9290 RETURN 9295 REM \''\''\''\''\''\''\''\''\''\''\'' ADD TEXT #1 9300 FOR i=1 TO d1-1 STEP 704 9310 IF i+703>d1-1 THEN GO TO 9340 9320 LET t$(i TO i+703)=u$(i TO i+703) 9330 GO TO 9350 9340 LET t$(i TO d1-1)=u$(i TO d1-1) 9350 NEXT i 9360 RETURN 9390 REM \''\''\''\''\''\''\''\'' ADD TEXT #2 9400 FOR i=i TO LEN v$ STEP 704 9410 IF i+703>LEN v$ THEN GO TO 9440 9420 LET t$(i+d1-1 TO i+d1+702)=v$(i TO i+703) 9430 GO TO 9450 9440 LET t$(i+d1-1 TO d1-1+LEN v$)=v$(i TO ) 9450 NEXT i 9460 RETURN 9490 REM \''\''\''\''\''\''\''\''\''\'' ADD TEXT #3 9500 LET n=d1-1+LEN a$ 9510 FOR i=1 TO LEN u$-d1 STEP 704 9520 IF i+703>LEN u$-d1 THEN GO TO 9550 9530 LET t$(i+n TO i+n+703)=u$(i+d1-1 TO i+d1-1+703) 9540 GO TO 9560 9550 LET t$(i+n TO )=u$(i+d1-1 TO ) 9560 NEXT i 9570 DIM u$(1) 9580 RETURN 9590 REM \''\''\''\''\''\''\''\''\''PRINT SCREEN 9600 CLS 9605 GO SUB 9100 9610 PRINT #1;AT 1,16-(LEN b$/2) ;b$ 9620 LET b=a+703 9630 IF b>LEN t$ THEN LET b=LEN t$ 9640 PRINT t$(a TO b) 9650 RETURN 9690 REM \''\''\''\''\''\'' DEFINED GRAPHICS 9700 FOR i=144 TO 164 9710 FOR j=0 TO 7 9720 READ a 9730 POKE USR CHR$ i+j,a 9740 NEXT j 9750 NEXT i 9760 RETURN 9777 REM \a\ -BOX 9778 DATA 255,129,129,129,129,129,129,255 9779 REM \b - Spot 9780 DATA 0,60,126,126,126,126,60,0 9781 REM \c - STAR 9782 DATA 0,16,16,124,56,56,68,0 9783 REM \d - Horizonal Bar 9784 DATA 0,0,255,255,255,255,0,0 9785 REM \e - Vertical Bar 9786 DATA 60,60,60,60,60,60,60,60 9787 REM \f - Top Left Corner 9788 DATA 0,0,63,63,63,63,60,60 9789 REM \g - Top Right Corner 9790 DATA 0,0,252,252,252,252,60,60 9791 REM \h - Bottom Left Corner 9792 DATA 60,60,63,63,63,63,0,0 9793 REM \i - Bottom Right Corner 9794 DATA 60,60,252,252,252,252,0,0 9795 REM \j- Left Arrow 9796 DATA 0,16,32,126,32,16,0,0 9797 REM \k -Down Arrow 9798 DATA 0,16,16,16,84,56,16,0 9799 REM \l -Right Arrow 9800 DATA 0,8,4,126,4,8,0,0 9801 REM \m - 2 Subscript 9802 DATA 0,0,0,56,8,56,32,56 9803 REM \n - 3 Subscript 9804 DATA 0,0,0,56,8,56,8,56 9805 REM \o - 4 Subscript 9806 DATA 0,0,0,40,40,56,8,8 9807 REM \p - 2 Superscript 9808 DATA 56,8,56,32,56,0,0,0 9809 REM \q - 3 Superscript 9810 DATA 56,8,56,8,56,0,0,0 9811 REM \r - 4 Superscript 9812 DATA 40,40,56,8,8,0,0,0 9813 REM \s - One Half 9814 DATA 130,132,136,151,161,71,132,7 9815 REM SPECTRUM - One Third 9816 DATA 130,132,136,151,161,71,129,7 9817 REM \u - One Fourth 9818 DATA 130,132,136,149,165,71,129,1 9820 REM \''\''\''\''\''\''\''\''\''\''\''\'' START HERE 9830 BEEP .5,10 9840 BORDER 0: PAPER 0: INK 9: CLS 9850 PRINT AT 3,12;"Textype" 9860 RESTORE 9778 9870 GO SUB 9700 9875 DIM t$(1) 9880 LET w=32 9890 POKE 23609,5 9920 GO TO 735 9930 REM \''\''\''\''\''\''\''\''\'' SAVE PROGRAM 9940 CLEAR 9950 SAVE "Textype" LINE 4608 9960 BEEP .1,7 9970 VERIFY "Textype" 9980 BEEP .1,7 9990 STOP ```