Edits text in eight screen-sized pages held in a single 5,120-character string. From a menu of typed commands, ded starts a new file, edit opens a page, look and list show pages on the screen or the printer, and save and load move the text to tape as a string array with verification. While typing, the cursor keys move around the page, DELETE closes up the line, SYMBOL SHIFT I tabs four places, and CAPS SHIFT 1 brings up a > prompt for commands such as top, bop, bol, eol and ok.
This program is on side B of the Long Island Sinclair Timex (LIST) user group library tape #3.5. The title screen credits C. F. Choo. The tape also carries a separate saved text file, also named word, with a short loader: a review of the program by P. Donnelly of Centerport, NY, written in Word itself. The review notes that a listing appeared in the May 1984 issue of PC World and reports FREE at 23,031 bytes with the text loaded.
Program Analysis
Program Structure
- Lines 50-150: command menu read with
INPUT LINE. - Lines 200-310: save the text with
SAVE f$ DATA T$()and verify it. - Lines 400-490:
listto the printer andlookon screen for a range of pages. - Lines 500-700: the editor loop, reading
INKEY$and dispatching on character codes (8-13 for the cursor keys and DELETE, 172 for the tab key, 7 for EDIT). - Lines 800-895: the
>secondary commands. - Lines 1000-2040: delete, insert, newline, cursor movement and tab routines.
- Lines 9000-9210: the help pages.
Text Storage
Each page is 640 characters (20 rows of 32), and the cursor’s offset into T$ is computed as row*32+640*(page-1)+col+1. Inserting a character shifts the rest of the row right with a slice assignment, and only if the last column of the row is blank, so text never wraps into the next line.
Notable Techniques
- The cursor is a flashing space printed at the current position, and the character underneath is reprinted from
T$as the cursor moves. - The review file is a plain
a$string saved withDATA; its three-line loader just loads and prints it.
Potential Issues
- Line 860 (
eol) ends withGO TO 890, but there is no line 890; execution falls through to line 895, which returns to the editor, so it works only by accident. - Line 474 in the
lookroutine jumps back to line 410, thelistprompt, on a bad page number, and line 485 waits at line 450, also in thelistroutine. - The listing on the tape contains the program twice in succession, the result of a doubled save.
Source Code
1 REM "word". word processor
5 BORDER 1: PAPER 1: INK 7
10 PRINT AT 5,4;"Welcome to word processor"
20 PRINT AT 8,12;"C.F.Choo"
30 PRINT AT 15,5; INK 6;"Press any key to start"
35 DIM T$(5120): LET page=1: LET pagend=640*page
40 IF INKEY$="" THEN GO TO 40
50 CLS
60 PRINT "d : for description": PRINT : PRINT "ded : create new text file": PRINT : PRINT "edit : present text file": PRINT
62 PRINT "save : text file onto tape": PRINT : PRINT "load : text file from tape": PRINT : PRINT "look : at text file": PRINT
64 PRINT "list : text file to printer": PRINT : PRINT "stop : the program"
68 INPUT "by your command? "; LINE c$
70 IF c$="ded" THEN GO TO 500
75 IF c$="d" THEN GO SUB 9000: GO TO 50
80 IF c$="save" THEN GO SUB 200: GO TO 50
82 IF c$="load" THEN GO SUB 3000: GO TO 50
85 IF c$="edit" THEN GO TO 900
88 IF c$="look" THEN GO SUB 470: GO TO 50
90 IF c$="list" THEN GO SUB 400: GO TO 50
95 IF c$="stop" THEN CLS : PRINT AT 11,12;"THE END": STOP
100 CLS : PRINT AT 21,0;"no such command": BEEP .2,24: BEEP .2,24: PAUSE 100: GO TO 50
150 GO TO 50
200 CLS : REM save file
210 PRINT "press q to quit saving": INPUT "enter filename please "; LINE f$
215 IF f$="q" THEN RETURN
220 IF LEN f$>10 THEN CLS : PRINT AT 20,0;"filename must be ten characters or less": BEEP .2,24: BEEP .2,24: PAUSE 200: GO TO 200
230 IF LEN f$=0 THEN CLS : PRINT AT 21,0;"no filename specified": BEEP .2,24: BEEP .2,24: PAUSE 100: GO TO 200
240 CLS : SAVE f$ DATA T$()
250 PRINT AT 5,4;"file saved": PRINT AT 7,3;"rewind tape for verifying"
260 PRINT AT 21,0; INK 6;"press any key if you are ready"
270 IF INKEY$="" THEN GO TO 270
280 CLS : PRINT AT 11,10;"start the tape"
290 VERIFY f$ DATA T$()
300 PRINT AT 21,0;"ready, please wait...": PAUSE 300: CLS : GO TO 60
310 RETURN
400 REM list routine
410 CLS : INPUT "list from page? ";f;
420 IF f<1 OR f>8 THEN PRINT AT 21,0;"It must between 1 and 8": BEEP .2,24: BEEP .2,24: PAUSE 100: CLS : GO TO 410
425 INPUT "to page? ";l
428 IF l<1 OR l>8 THEN PRINT AT 21,0;"It must be between 1 and 8": BEEP .2,24: BEEP .2,24: PAUSE 100: CLS : GO TO 410
430 CLS : LPRINT T$(640*(f-1)+1 TO 640*l)
440 PRINT AT 21,0; INK 6;"Press any key to continue..."
450 IF INKEY$="" THEN GO TO 450
460 RETURN
470 REM look routine
472 CLS : INPUT "look at page? ";f;
474 IF f<1 OR f>8 THEN PRINT AT 21,0;"It must be between 1 and 8": BEEP .2,24: BEEP .2,24: PAUSE 100: CLS : GO TO 410
476 INPUT "to page? ";l
478 IF l<1 OR l>8 THEN PRINT AT 21,0;"It must be between 1 and 8": BEEP .2,24: BEEP .2,24: PAUSE 100: CLS : GO TO 410
480 CLS : PRINT T$(640*(f-1)+1 TO 640*l)
482 PRINT AT 21,0; INK 6;"Press any key to continue..."
485 IF INKEY$="" THEN GO TO 450
490 RETURN
500 CLS : DIM T$(5120): LET page=1: REM ded routine
510 LET row=0: LET col=0
520 PRINT AT 21,0; INK 6;"page ";page
530 PRINT AT row,col; FLASH 1;" ";: LET cur=row*32+(640*(page-1)+col+1)
540 IF INKEY$<>"" THEN GO TO 540
550 LET n$=INKEY$: IF n$="" THEN GO TO 550
555 BEEP .01,0: PRINT AT 21,10;" "
560 IF CODE n$>=32 AND CODE n$<=127 THEN GO TO 1300
570 IF CODE n$=13 THEN GO TO 1400
590 IF CODE n$=12 THEN GO TO 1000
600 IF CODE n$=8 THEN GO TO 1500
610 IF CODE n$=9 THEN GO TO 1600
620 IF CODE n$=11 THEN GO TO 1700
630 IF CODE n$=10 THEN GO TO 1800
640 IF CODE n$=172 THEN GO TO 2000
650 IF CODE INKEY$=7 THEN PRINT AT row,col;" ": GO TO 800
700 GO TO 520
800 REM secondary command
810 INPUT "> "; LINE C$
820 IF C$="ok" THEN GO TO 50
830 IF C$="top" THEN LET row=0: LET cur=32*row+(640*(page-1)+col+1): PRINT AT row,col+1;T$(cur TO pagend-1): GO TO 520
840 IF C$="bop" THEN CLS : LET row=19: LET newcur=32*row+(640*(page-1)+col+1): PRINT AT 0,0;T$(640*(page-1)+1 TO newcur-1): LET cur=newcur: PRINT AT row,col+1;T$(cur TO pagend-1): GO TO 520
850 IF C$="bol" THEN LET col=0: LET cur=32*row+(640*(page-1)+1): PRINT AT row,1;T$(cur TO cur+30): GO TO 520
860 IF C$="eol" THEN LET col=31: LET cur=row*32+(640*(page-1)+col+1): LET t=row*32+(640*(page-1)+1): PRINT AT row,0;T$(t TO t+30): GO TO 890
870 IF C$="nc" THEN GO TO 520
880 PRINT AT 21,10; INK 6;"<<no such command>>": BEEP .2,24: BEEP .2,24: GO TO 800
895 GO TO 520
900 REM edit routine
910 CLS : INPUT "which page? ";p
920 PRINT AT 0,1;T$(640*(p-1)+1 TO 640*p)
930 LET page=p: LET pagend=640*page
940 GO TO 510
1000 REM delete routine
1010 IF row=0 AND col=0 THEN PRINT AT 21,10; INK 6;"<<beginning of page>>": BEEP .2,24: BEEP .2,24: GO TO 520
1020 IF col=0 THEN LET T$(cur-1)=" ": PRINT AT row,col;" ": LET row=row-1: LET col=31: GO TO 520
1030 LET T$(cur-1 TO cur+31-col)=T$(cur TO cur+31-col): PRINT AT row,col;T$(cur-1 TO cur+31-col): LET col=col-1
1040 GO TO 520
1300 REM add characters
1310 IF page=8 THEN IF row=19 AND col=31 THEN PRINT AT 21,10; INK 6;"<<end of file>>": BEEP .2,24: BEEP .2,24: GO TO 520
1315 IF row=19 AND col=31 THEN CLS : LET row=0: LET col=1: PRINT AT 0,0;n$: LET T$(cur+1)=n$: LET page=page+1: LET pagend=640*page: GO TO 520
1320 IF T$(cur)<>" " AND T$(cur+31-col)<>" " THEN BEEP .2,24: GO TO 520
1325 IF T$(cur)<>" " AND T$(cur+31-col)=" " THEN LET T$(cur+1 TO cur+31-col)=T$(cur TO cur+31-col): LET T$(cur)=n$: PRINT AT row,col;" ": PRINT AT row,col;n$: LET col=col+1: PRINT AT row,col+1;T$(cur+1 TO cur+31-col): GO TO 520
1330 IF col=31 THEN PRINT AT row,col;" ": PRINT AT row,col;n$: LET T$(cur)=n$: LET row=row+1: LET col=0: GO TO 520
1340 LET T$(cur)=n$
1350 PRINT AT row,col;" ": PRINT AT row,col;n$: LET col=col+1
1360 GO TO 520
1400 REM newline routine
1410 IF row=19 AND page=8 THEN PRINT AT 21,10; INK 6;"<<end of file>>": GO TO 520
1420 PRINT AT row,col;T$(cur TO cur+31-col)
1430 LET row=row+1: LET col=0: LET cur=row*32+(640*(page-1)+1): PRINT AT row,col+1;T$(cur TO pagend-1)
1432 IF row=19 THEN PRINT AT 21,10; INK 6;"<<last line>>"
1435 IF row>19 THEN LET page=page+1: CLS : LET pagend=640*page: GO TO 510
1440 GO TO 520
1500 REM left routine
1504 IF page=1 THEN IF row=0 AND col=0 THEN PRINT AT 21,10; INK 6;"<<top of file>>": BEEP .2,24: BEEP .2,24: GO TO 520
1505 IF row=0 AND col=0 THEN PRINT AT 21,10; INK 6;"beginning of page": BEEP .2,24: BEEP .2,24: GO TO 520
1510 IF col=0 THEN PRINT AT row,col;T$(cur-1): LET row=row-1: LET col=31: GO TO 520
1520 PRINT AT row,col;T$(cur-1)
1540 LET col=col-1
1550 GO TO 520
1600 REM cursor right routine
1605 IF page=8 THEN IF row=19 AND col=31 THEN PRINT AT 21,10; INK 6;"<<end of file>>": BEEP .2,24: BEEP .2,24: GO TO 520
1610 IF row=19 AND col=31 THEN PRINT AT 21,10; INK 6;"<<end of page>>": BEEP .2,24: BEEP .2,24: GO TO 520
1620 IF col=31 THEN PRINT AT row,col;T$(cur): LET row=row+1: LET col=0: GO TO 520
1630 PRINT AT row,col;T$(cur): LET col=col+1
1650 GO TO 520
1700 REM cursor up routine
1710 IF page=1 AND row=0 THEN PRINT AT 21,10; INK 6;"<<top of file>>": BEEP .2,24: BEEP .2,24: GO TO 520
1720 IF row=0 AND col=31 THEN CLS : LET page=page-1: LET pagend=640*page: LET row=19: LET cur=row*32+(640*(page-1)+col+1): PRINT AT 0,0;T$(640*(page-1)+1 TO cur-1): GO TO 520
1730 IF row=0 THEN CLS : LET page=page-1: LET pagend=640*page: LET row=19: LET cur=row*32+(640*(page-1)+col+1): PRINT AT 0,0;T$(640*(page-1)+1 TO cur-1): PRINT AT row,col+1;T$(cur TO pagend-1): GO TO 520
1740 IF col=31 THEN LET row=row-1: LET cur=32*row+(640*(page-1)+col+1): PRINT AT row+1,0;T$(cur TO pagend-1): GO TO 520
1750 LET row=row-1: LET cur=32*row+(640*(page-1)+1+col): PRINT AT row,col+1;T$(cur TO pagend-1)
1770 GO TO 520
1800 REM down routine
1810 IF page=8 AND row=19 THEN PRINT AT 21,10; INK 6;"<<end of file>>": BEEP .2,24: BEEP .2,24: GO TO 520
1820 IF row=18 AND col=31 THEN CLS : LET page=page+1: LET pagend=640*page: LET row=0: LET cur=row*32+(640*(page-1)+col+1): PRINT AT 0,0;T$(640*(page-1)+1 TO cur-1): PRINT AT row+1,col;T$(cur TO pagend-1): GO TO 520
1830 IF row=19 THEN CLS : LET page=page+1: LET pagend=640*page: LET row=0: LET cur=row*32+(640*(page-1)+col+1): PRINT AT 0,0;T$(640*(page-1)+1 TO cur-1): PRINT AT row,col+1;T$(cur TO pagend-1): GO TO 520
1840 IF col=31 THEN PRINT AT row,col;T$(cur): LET row=row+1: PRINT AT row,0;T$(cur+1 TO cur+31): LET cur=32*row+(640*(page-1)+col+1): PRINT AT row+1,0;T$(cur TO pagend-1): GO TO 520
1850 PRINT AT row,col;T$(cur TO cur+31): LET row=row+1: LET cur=32*row+(640*(page-1)+col+1): PRINT AT row,col+1;T$(cur TO pagend-1)
1870 GO TO 520
2000 REM tab routine
2010 IF col<=26 THEN PRINT AT row,col;T$(cur TO cur+3): LET col=col+4: PRINT AT row,col+1;T$(cur+4 TO cur+4+31-col)
2040 GO TO 520
3000 REM loadtext routine
3010 CLS : PRINT "Press q to return to menu."
3020 INPUT "Enter filename please "; LINE f$
3030 IF f$="q" THEN RETURN
3040 IF f$="" THEN PRINT AT 20,0;"I will load the first file that I find."
3050 PRINT AT 10,0;"Start the tape."
3060 LOAD f$ DATA T$()
3070 BEEP .1,0: CLS : PRINT AT 10,0;"Stop the tape."
3080 PAUSE 300: RETURN
9000 REM description
9010 CLS : PRINT "Before using this word processor, there are several commands you must know. eg."
9020 PRINT : PRINT "ded : clears the file": PRINT AT 5,6;"and allows you to": PRINT AT 6,6;"enter and edit new text"
9030 PRINT : PRINT "save : saves text onto tape"
9040 PRINT : PRINT "list : produces a listing on": PRINT AT 11,6;"printer"
9045 PRINT : PRINT "look : looks at written text": PRINT : PRINT "edit : edits the written text": PRINT
9048 PRINT "stop : stops the program": PRINT
9050 PRINT "These are the commands available before entering word processor."
9070 PRINT AT 21,10; INK 5;"Press any key for next page..."
9080 IF INKEY$="" THEN GO TO 9080
9090 CLS : PRINT "While you are in ded or edit mode you can do several things": PRINT
9100 PRINT "Press CAP-SHIFT 1 gives you a prompt '>'. ";
9110 PRINT "You can perform the following command. "
9160 PRINT : PRINT "top : cursor to top of page"
9170 PRINT : PRINT "bop : cursor to bottom of page"
9172 PRINT : PRINT "bol : cursor to beginning of line"
9175 PRINT : PRINT "eol : cursor to end of line"
9178 PRINT : PRINT "nc : no change"
9180 PRINT : PRINT "ok : gets you out of word proc- essor"
9182 PRINT AT 21,0; INK 6;"Press any key for next page"
9184 IF INKEY$="" THEN GO TO 9184
9185 CLS : PRINT : PRINT "press CAP-SHIFT 5,6,7,8 : moves cursor as indicated by arrow"
9186 PRINT : PRINT "press SYMBOL-SHIFT I puts cursor four spaces forward"
9190 PRINT AT 21,0; INK 6;"Press any key to continue"
9200 IF INKEY$="" THEN GO TO 9200
9210 RETURN
1 REM "word". word processor
5 BORDER 1: PAPER 1: INK 7
10 PRINT AT 5,4;"Welcome to word processor"
20 PRINT AT 8,12;"C.F.Choo"
30 PRINT AT 15,5; INK 6;"Press any key to start"
35 DIM T$(5120): LET page=1: LET pagend=640*page
40 IF INKEY$="" THEN GO TO 40
50 CLS
60 PRINT "d : for description": PRINT : PRINT "ded : create new text file": PRINT : PRINT "edit : present text file": PRINT
62 PRINT "save : text file onto tape": PRINT : PRINT "load : text file from tape": PRINT : PRINT "look : at text file": PRINT
64 PRINT "list : text file to printer": PRINT : PRINT "stop : the program"
68 INPUT "by your command? "; LINE c$
70 IF c$="ded" THEN GO TO 500
75 IF c$="d" THEN GO SUB 9000: GO TO 50
80 IF c$="save" THEN GO SUB 200: GO TO 50
82 IF c$="load" THEN GO SUB 3000: GO TO 50
85 IF c$="edit" THEN GO TO 900
88 IF c$="look" THEN GO SUB 470: GO TO 50
90 IF c$="list" THEN GO SUB 400: GO TO 50
95 IF c$="stop" THEN CLS : PRINT AT 11,12;"THE END": STOP
100 CLS : PRINT AT 21,0;"no such command": BEEP .2,24: BEEP .2,24: PAUSE 100: GO TO 50
150 GO TO 50
200 CLS : REM save file
210 PRINT "press q to quit saving": INPUT "enter filename please "; LINE f$
215 IF f$="q" THEN RETURN
220 IF LEN f$>10 THEN CLS : PRINT AT 20,0;"filename must be ten characters or less": BEEP .2,24: BEEP .2,24: PAUSE 200: GO TO 200
230 IF LEN f$=0 THEN CLS : PRINT AT 21,0;"no filename specified": BEEP .2,24: BEEP .2,24: PAUSE 100: GO TO 200
240 CLS : SAVE f$ DATA T$()
250 PRINT AT 5,4;"file saved": PRINT AT 7,3;"rewind tape for verifying"
260 PRINT AT 21,0; INK 6;"press any key if you are ready"
270 IF INKEY$="" THEN GO TO 270
280 CLS : PRINT AT 11,10;"start the tape"
290 VERIFY f$ DATA T$()
300 PRINT AT 21,0;"ready, please wait...": PAUSE 300: CLS : GO TO 60
310 RETURN
400 REM list routine
410 CLS : INPUT "list from page? ";f;
420 IF f<1 OR f>8 THEN PRINT AT 21,0;"It must between 1 and 8": BEEP .2,24: BEEP .2,24: PAUSE 100: CLS : GO TO 410
425 INPUT "to page? ";l
428 IF l<1 OR l>8 THEN PRINT AT 21,0;"It must be between 1 and 8": BEEP .2,24: BEEP .2,24: PAUSE 100: CLS : GO TO 410
430 CLS : LPRINT T$(640*(f-1)+1 TO 640*l)
440 PRINT AT 21,0; INK 6;"Press any key to continue..."
450 IF INKEY$="" THEN GO TO 450
460 RETURN
470 REM look routine
472 CLS : INPUT "look at page? ";f;
474 IF f<1 OR f>8 THEN PRINT AT 21,0;"It must be between 1 and 8": BEEP .2,24: BEEP .2,24: PAUSE 100: CLS : GO TO 410
476 INPUT "to page? ";l
478 IF l<1 OR l>8 THEN PRINT AT 21,0;"It must be between 1 and 8": BEEP .2,24: BEEP .2,24: PAUSE 100: CLS : GO TO 410
480 CLS : PRINT T$(640*(f-1)+1 TO 640*l)
482 PRINT AT 21,0; INK 6;"Press any key to continue..."
485 IF INKEY$="" THEN GO TO 450
490 RETURN
500 CLS : DIM T$(5120): LET page=1: REM ded routine
510 LET row=0: LET col=0
520 PRINT AT 21,0; INK 6;"page ";page
530 PRINT AT row,col; FLASH 1;" ";: LET cur=row*32+(640*(page-1)+col+1)
540 IF INKEY$<>"" THEN GO TO 540
550 LET n$=INKEY$: IF n$="" THEN GO TO 550
555 BEEP .01,0: PRINT AT 21,10;" "
560 IF CODE n$>=32 AND CODE n$<=127 THEN GO TO 1300
570 IF CODE n$=13 THEN GO TO 1400
590 IF CODE n$=12 THEN GO TO 1000
600 IF CODE n$=8 THEN GO TO 1500
610 IF CODE n$=9 THEN GO TO 1600
620 IF CODE n$=11 THEN GO TO 1700
630 IF CODE n$=10 THEN GO TO 1800
640 IF CODE n$=172 THEN GO TO 2000
650 IF CODE INKEY$=7 THEN PRINT AT row,col;" ": GO TO 800
700 GO TO 520
800 REM secondary command
810 INPUT "> "; LINE C$
820 IF C$="ok" THEN GO TO 50
830 IF C$="top" THEN LET row=0: LET cur=32*row+(640*(page-1)+col+1): PRINT AT row,col+1;T$(cur TO pagend-1): GO TO 520
840 IF C$="bop" THEN CLS : LET row=19: LET newcur=32*row+(640*(page-1)+col+1): PRINT AT 0,0;T$(640*(page-1)+1 TO newcur-1): LET cur=newcur: PRINT AT row,col+1;T$(cur TO pagend-1): GO TO 520
850 IF C$="bol" THEN LET col=0: LET cur=32*row+(640*(page-1)+1): PRINT AT row,1;T$(cur TO cur+30): GO TO 520
860 IF C$="eol" THEN LET col=31: LET cur=row*32+(640*(page-1)+col+1): LET t=row*32+(640*(page-1)+1): PRINT AT row,0;T$(t TO t+30): GO TO 890
870 IF C$="nc" THEN GO TO 520
880 PRINT AT 21,10; INK 6;"<<no such command>>": BEEP .2,24: BEEP .2,24: GO TO 800
895 GO TO 520
900 REM edit routine
910 CLS : INPUT "which page? ";p
920 PRINT AT 0,1;T$(640*(p-1)+1 TO 640*p)
930 LET page=p: LET pagend=640*page
940 GO TO 510
1000 REM delete routine
1010 IF row=0 AND col=0 THEN PRINT AT 21,10; INK 6;"<<beginning of page>>": BEEP .2,24: BEEP .2,24: GO TO 520
1020 IF col=0 THEN LET T$(cur-1)=" ": PRINT AT row,col;" ": LET row=row-1: LET col=31: GO TO 520
1030 LET T$(cur-1 TO cur+31-col)=T$(cur TO cur+31-col): PRINT AT row,col;T$(cur-1 TO cur+31-col): LET col=col-1
1040 GO TO 520
1300 REM add characters
1310 IF page=8 THEN IF row=19 AND col=31 THEN PRINT AT 21,10; INK 6;"<<end of file>>": BEEP .2,24: BEEP .2,24: GO TO 520
1315 IF row=19 AND col=31 THEN CLS : LET row=0: LET col=1: PRINT AT 0,0;n$: LET T$(cur+1)=n$: LET page=page+1: LET pagend=640*page: GO TO 520
1320 IF T$(cur)<>" " AND T$(cur+31-col)<>" " THEN BEEP .2,24: GO TO 520
1325 IF T$(cur)<>" " AND T$(cur+31-col)=" " THEN LET T$(cur+1 TO cur+31-col)=T$(cur TO cur+31-col): LET T$(cur)=n$: PRINT AT row,col;" ": PRINT AT row,col;n$: LET col=col+1: PRINT AT row,col+1;T$(cur+1 TO cur+31-col): GO TO 520
1330 IF col=31 THEN PRINT AT row,col;" ": PRINT AT row,col;n$: LET T$(cur)=n$: LET row=row+1: LET col=0: GO TO 520
1340 LET T$(cur)=n$
1350 PRINT AT row,col;" ": PRINT AT row,col;n$: LET col=col+1
1360 GO TO 520
1400 REM newline routine
1410 IF row=19 AND page=8 THEN PRINT AT 21,10; INK 6;"<<end of file>>": GO TO 520
1420 PRINT AT row,col;T$(cur TO cur+31-col)
1430 LET row=row+1: LET col=0: LET cur=row*32+(640*(page-1)+1): PRINT AT row,col+1;T$(cur TO pagend-1)
1432 IF row=19 THEN PRINT AT 21,10; INK 6;"<<last line>>"
1435 IF row>19 THEN LET page=page+1: CLS : LET pagend=640*page: GO TO 510
1440 GO TO 520
1500 REM left routine
1504 IF page=1 THEN IF row=0 AND col=0 THEN PRINT AT 21,10; INK 6;"<<top of file>>": BEEP .2,24: BEEP .2,24: GO TO 520
1505 IF row=0 AND col=0 THEN PRINT AT 21,10; INK 6;"beginning of page": BEEP .2,24: BEEP .2,24: GO TO 520
1510 IF col=0 THEN PRINT AT row,col;T$(cur-1): LET row=row-1: LET col=31: GO TO 520
1520 PRINT AT row,col;T$(cur-1)
1540 LET col=col-1
1550 GO TO 520
1600 REM cursor right routine
1605 IF page=8 THEN IF row=19 AND col=31 THEN PRINT AT 21,10; INK 6;"<<end of file>>": BEEP .2,24: BEEP .2,24: GO TO 520
1610 IF row=19 AND col=31 THEN PRINT AT 21,10; INK 6;"<<end of page>>": BEEP .2,24: BEEP .2,24: GO TO 520
1620 IF col=31 THEN PRINT AT row,col;T$(cur): LET row=row+1: LET col=0: GO TO 520
1630 PRINT AT row,col;T$(cur): LET col=col+1
1650 GO TO 520
1700 REM cursor up routine
1710 IF page=1 AND row=0 THEN PRINT AT 21,10; INK 6;"<<top of file>>": BEEP .2,24: BEEP .2,24: GO TO 520
1720 IF row=0 AND col=31 THEN CLS : LET page=page-1: LET pagend=640*page: LET row=19: LET cur=row*32+(640*(page-1)+col+1): PRINT AT 0,0;T$(640*(page-1)+1 TO cur-1): GO TO 520
1730 IF row=0 THEN CLS : LET page=page-1: LET pagend=640*page: LET row=19: LET cur=row*32+(640*(page-1)+col+1): PRINT AT 0,0;T$(640*(page-1)+1 TO cur-1): PRINT AT row,col+1;T$(cur TO pagend-1): GO TO 520
1740 IF col=31 THEN LET row=row-1: LET cur=32*row+(640*(page-1)+col+1): PRINT AT row+1,0;T$(cur TO pagend-1): GO TO 520
1750 LET row=row-1: LET cur=32*row+(640*(page-1)+1+col): PRINT AT row,col+1;T$(cur TO pagend-1)
1770 GO TO 520
1800 REM down routine
1810 IF page=8 AND row=19 THEN PRINT AT 21,10; INK 6;"<<end of file>>": BEEP .2,24: BEEP .2,24: GO TO 520
1820 IF row=18 AND col=31 THEN CLS : LET page=page+1: LET pagend=640*page: LET row=0: LET cur=row*32+(640*(page-1)+col+1): PRINT AT 0,0;T$(640*(page-1)+1 TO cur-1): PRINT AT row+1,col;T$(cur TO pagend-1): GO TO 520
1830 IF row=19 THEN CLS : LET page=page+1: LET pagend=640*page: LET row=0: LET cur=row*32+(640*(page-1)+col+1): PRINT AT 0,0;T$(640*(page-1)+1 TO cur-1): PRINT AT row,col+1;T$(cur TO pagend-1): GO TO 520
1840 IF col=31 THEN PRINT AT row,col;T$(cur): LET row=row+1: PRINT AT row,0;T$(cur+1 TO cur+31): LET cur=32*row+(640*(page-1)+col+1): PRINT AT row+1,0;T$(cur TO pagend-1): GO TO 520
1850 PRINT AT row,col;T$(cur TO cur+31): LET row=row+1: LET cur=32*row+(640*(page-1)+col+1): PRINT AT row,col+1;T$(cur TO pagend-1)
1870 GO TO 520
2000 REM tab routine
2010 IF col<=26 THEN PRINT AT row,col;T$(cur TO cur+3): LET col=col+4: PRINT AT row,col+1;T$(cur+4 TO cur+4+31-col)
2040 GO TO 520
3000 REM loadtext routine
3010 CLS : PRINT "Press q to return to menu."
3020 INPUT "Enter filename please "; LINE f$
3030 IF f$="q" THEN RETURN
3040 IF f$="" THEN PRINT AT 20,0;"I will load the first file that I find."
3050 PRINT AT 10,0;"Start the tape."
3060 LOAD f$ DATA T$()
3070 BEEP .1,0: CLS : PRINT AT 10,0;"Stop the tape."
3080 PAUSE 300: RETURN
9000 REM description
9010 CLS : PRINT "Before using this word processor, there are several commands you must know. eg."
9020 PRINT : PRINT "ded : clears the file": PRINT AT 5,6;"and allows you to": PRINT AT 6,6;"enter and edit new text"
9030 PRINT : PRINT "save : saves text onto tape"
9040 PRINT : PRINT "list : produces a listing on": PRINT AT 11,6;"printer"
9045 PRINT : PRINT "look : looks at written text": PRINT : PRINT "edit : edits the written text": PRINT
9048 PRINT "stop : stops the program": PRINT
9050 PRINT "These are the commands available before entering word processor."
9070 PRINT AT 21,10; INK 5;"Press any key for next page..."
9080 IF INKEY$="" THEN GO TO 9080
9090 CLS : PRINT "While you are in ded or edit mode you can do several things": PRINT
9100 PRINT "Press CAP-SHIFT 1 gives you a prompt '>'. ";
9110 PRINT "You can perform the following command. "
9160 PRINT : PRINT "top : cursor to top of page"
9170 PRINT : PRINT "bop : cursor to bottom of page"
9172 PRINT : PRINT "bol : cursor to beginning of line"
9175 PRINT : PRINT "eol : cursor to end of line"
9178 PRINT : PRINT "nc : no change"
9180 PRINT : PRINT "ok : gets you out of word proc- essor"
9182 PRINT AT 21,0; INK 6;"Press any key for next page"
9184 IF INKEY$="" THEN GO TO 9184
9185 CLS : PRINT : PRINT "press CAP-SHIFT 5,6,7,8 : moves cursor as indicated by arrow"
9186 PRINT : PRINT "press SYMBOL-SHIFT I puts cursor four spaces forward"
9190 PRINT AT 21,0; INK 6;"Press any key to continue"
9200 IF INKEY$="" THEN GO TO 9200
9210 RETURNNote: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.