Word Pro

Developer(s): Peter Hoffman
Date: 198x
Type: Program
Platform(s): TS 2068

Word processor written in BASIC.

Appears on

Gallery

Source Code

    1 REM "word pro"
    2 REM submittedto LIST by Peter Hoffmann
    3 REM to end letter or document type a .(period) at beginning of next line
    4 REM type GOTO 8030 to get back to Print/Justify/Continue menu
    5 DIM w$(300,32): DIM b$(32)
   10 CLS : PRINT TAB 10;"TS2068-word pro";AT 5,0;"T=LOAD TEXT FROM TAPE"''"K=ENTER TEXT FROM KEYBOARD"
   15 IF INKEY$="k" OR INKEY$="K" THEN GO TO 100
   20 IF INKEY$="t" OR INKEY$="T" THEN GO TO 7000
   25 GO TO 15
  100 LET x=0
  150 CLS 
  200 FOR j=0 TO 19
  210 FOR l=0 TO 31
  300 PRINT AT j,l; FLASH 1; OVER 1;CHR$ 32
  310 PAUSE 0: LET i$=INKEY$
  320 IF i$=CHR$ 8 AND l<>0 THEN LET l=l-2: GO TO 500
  330 IF i$=CHR$ 8 AND j<>0 THEN PRINT AT j,0;w$(x*20+j+1,1): LET j=j-1: LET l=30: GO TO 500
  340 IF i$=CHR$ 9 AND l<>31 THEN GO TO 500
  350 IF i$=CHR$ 9 AND j<>19 THEN PRINT AT j,31;CHR$ (CODE (w$(x*20+j+1,32))+19*(w$(x*20+j+1,32)=CHR$ 13)): LET j=j+1: LET l=1: GO TO 500
  360 IF l=0 AND i$="." THEN LET l=31: LET j=19: GO TO 540
  370 IF i$=CHR$ 12 AND 1<>0 THEN LET w$(x*20+j+1,l)=CHR$ 32: LET l=l-2: GO TO 500
  380 IF i$=CHR$ 12 AND j<>0 THEN PRINT AT j,0;w$(x*20+j+1): LET j=j-1: LET l=31: LET w$(x*20+j+1,l)=CHR$ 32: LET l=l-2: GO TO 500
  390 IF i$=CHR$ 13 THEN LET l=31: GO TO 410
  400 IF i$<CHR$ 32 THEN GO TO 310
  410 IF l=31 AND i$<>CHR$ 32 AND i$<>CHR$ 13 THEN LET i$=CHR$ 45
  420 BEEP .01,20+20*(i$=CHR$ 32)
  430 LET w$(x*20+j+1,l+1)=i$
  500 PRINT AT j,0;w$(x*20+j+1)
  510 IF w$(x*20+j+1,32)=CHR$ 13 THEN PRINT AT j,31;CHR$ 32
  520 IF l=26 THEN BEEP .5,50
  530 IF l>25 AND (i$=CHR$ 32 OR i$=CHR$ 45) THEN LET l=32
  540 NEXT l: BEEP .5,20
  600 NEXT j
 1000 PRINT AT 21,0;"P=PRINT:J=JUSTIFY:C=CONT"
 1010 IF INKEY$="c" OR INKEY$="C" THEN GO TO 1100
 1020 IF INKEY$="P" OR INKEY$="p" THEN GO TO 1050
 1030 IF INKEY$="J" OR INKEY$="j" THEN GO SUB 5000: GO TO 1000
 1040 GO TO 1010
 1050 PRINT AT 21,0;b$: COPY : GO TO 1000
 1100 CLS : PRINT "M=More Text:S=Save"
 1110 IF INKEY$="M" OR INKEY$="m" THEN GO TO 1200  
 1120 IF INKEY$="S" OR INKEY$="s" THEN GO TO 8000
 1130 GO TO 1110
 1200 IF x=14 THEN PRINT AT 21,0;"No More room:Choose Save option": PAUSE 0: GO TO 1100
 1210 LET x=x+1: GO TO 150
 5000 PRINT AT 21,0;b$
 5005 FOR j=x*20+1 TO x*20+20
 5010 LET a$=w$(j)
 5015 IF a$(32)<>CHR$ 32 THEN GO TO 5200
 5020 LET s=0: FOR l=32 TO 1 STEP -1
 5025 IF a$(l)<>CHR$ 32 THEN GO TO 5035
 5030 LET s=s+1: NEXT l: IF s=32 THEN GO TO 5200
 5035 LET d=2
 5040 FOR l=2 TO 32
 5045 IF a$(l)<>CHR$ 32 THEN GO TO 5090
 5050 FOR k=32 TO l+1 STEP -1: LET a$(k)=a$(k-1): NEXT k
 5055 LET l=l+d
 5060 IF a$(32)<>CHR$ 32 THEN GO TO 5100
 5090 NEXT l
 5100 PRINT AT j-x*20-1,0;a$
 5150 IF a$(32)=CHR$ 32 THEN LET d=d+1: GO TO 5040
 5170 LET w$(j)=a$
 5200 NEXT j
 5300 RETURN 
 7000 INPUT "Filename?";n$
 7005 IF n$="" THEN GO TO 7000
 7010 PRINT AT 15,0;"LOAD TAPE";n$
 7015 LOAD n$ DATA w$()
 7020 LET x=0
 7025 FOR j=x+1 TO x+20: LPRINT w$(j): NEXT j
 7030 LET x=x+20: IF x=300 THEN GO TO 7055
 7035 CLS : PRINT "Press S to stop"''"or any other key to continue"
 7040 PAUSE 0
 7045 IF INKEY$="s" OR INKEY$="S" THEN GO TO 7055
 7050 GO TO 7025
 7055 CLS : PRINT "TEXT COMPLETE"''"PRESS R TO REPEAT"''"OR X TO STOP"
 7060 IF INKEY$="R" OR INKEY$="r" THEN GO TO 7020
 7065 IF INKEY$="X" OR INKEY$="x" THEN GO TO 9999
 7070 GO TO 7060
 8000 INPUT "Filename?";n$
 8010 IF n$="" THEN GO TO 8000
 8020 IF LEN n$>10 THEN LET n$=n$( TO 10)
 8030 PRINT "Saving as: ";n$
 8040 SAVE n$ DATA w$()
 8050 GO TO 9999
 9000 CLEAR : SAVE "WP" LINE 0
 9999 STOP 
Scroll to Top