home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / C64Software / SIMPLE-WORD-PROCESSOR (.txt) < prev    next >
Commodore BASIC  |  2019-04-13  |  6KB  |  228 lines

  1. 5 POKE53280,12:POKE53281,12:PRINT"[147][144]"
  2. 6 DEFFNE(X)=FRE(0)-65536*(FRE(0)<0)
  3. 7 T7%=PEEK(213):Y1%=(T7%+2)/20:YT%=(T7%-21)/3+1
  4. 8 OPEN4,4,7:IFY1%=2ANDFNE(0)<31000THENY1%=3
  5. 10 IFY1%>2THENPRINT#4:CLOSE4:OPEN4,4
  6. 15 DK%=1
  7. 20 T1=79:MG=1:ET=INT(FNE(0)/60)
  8. 25 Y2%=4:Y3%=4:Y4%=17:CD$="":PK%=194
  9. 27 IFY1%>1THENCD$=CD$+"":Y2%=2:Y3%=10:Y4%=21:PK%=52
  10. 30 LL=1:G$=CHR$(34):SH$=CHR$(160):DIMT$(ET),TR$(20)
  11. 45 DEFFNA(X)=W3+(Z6-1)/Y2%
  12. 50 S$=CHR$(32):FORI=1TO15:SQ$=SQ$+S$:NEXT:SP$=LEFT$(SQ$,5)
  13. 70 GOTO100
  14. 85 PRINTTAB(YT%)"**[196]ISK ERROR**":GOTO95
  15. 90 PRINTTAB(YT%)"*[206]O FILE IN MEMORY*"
  16. 95 GOSUB18000
  17. 100 :
  18. 105 IFY1%<3THENPOKE788,PK%:PRINT"";:GOTO110
  19. 107 POKE144,88:POKE59468,14
  20. 110 PRINT"[147]"TAB(YT%)"**[207]PERATIONS**":PRINTTAB(YT%)"--------------"
  21. 150 PRINTTAB(YT%)"[215][146]RITE":PRINTTAB(YT%)"[197][146]DIT TEXT"
  22. 195 PRINTTAB(YT%)"[196][146]ISPLAY TEXT":PRINTTAB(YT%)"[193][146]DDRESS LETTER"
  23. 200 PRINTTAB(YT%)"[208][146]RINT TEXT"
  24. 220 PRINTTAB(YT%)"[198][146]ILE COMMANDS":PRINTTAB(YT%)"[211][146]ET FORMAT":
  25. 225 PRINTTAB(YT%)"[209][146]UIT":PRINTTAB(YT%)"[195][210][211][210]^[146] [212].[207].[198]."
  26. 230 AC=0:RW=0:FORI=1TO2:NEXTI:FORJ=1TO2:NEXTJ
  27. 240 PRINTTAB(YT%+6)"[215]AIT":GOSUB19000:CLOSE2
  28. 300 PRINTTAB(YT%-1)"[145]";INT(FNE(0)/(T1-5))"LINES FREE"
  29. 400 PRINTTAB(YT%)"[212]OP LINE:"HI
  30. 500 GOSUB18010
  31. 520 IFA$="[145]"THENPRINT#4:GOTO500
  32. 530 FORI=1TO9:IFA$=MID$("WED[196]APFSQ",I,1)THEN570
  33. 540 NEXTI:GOTO500
  34. 570 PRINT"[147]":ONIGOTO1000,5500,6000,6000,600,12000,4000,21000,8000
  35. 580 GOTO100
  36. 600 FORI=1TO5:PRINT"[147][193]DDRESSEE'S NAME":PRINT"[193]DDRESS":PRINT"[195]ITY"
  37. 669 PRINT"[211]TATE + [218]IP":PRINT"[212]ODAY'S DATE"
  38. 673 FORJ=1TO5:PRINTLEFT$(CD$,J*4);"  "C$(J);:IFC$(J)=""THENPRINTSH$
  39. 675 NEXTJ
  40. 678 PRINTLEFT$(CD$,I*4);:INPUTC$(I):IFC$(I)=SH$THENC$(I)=""
  41. 680 NEXTI
  42. 684 PRINT"OK? (Y/N)":GOSUB18000:IFA$="N"THEN600
  43. 690 GOTO100
  44. 1000 PRINT"[215]RITE":PRINT"[210][197][212][213][210][206][146] NEW PARAGRAPH"
  45. 1005 IFHI>0THENPRINTHI;T$(HI)""
  46. 1030 GOSUB10000:IFL<2ORLL=>ETTHEN100
  47. 1040 T$(LL)=L$:PRINT:LL=LL+1
  48. 1060 GOTO1030
  49. 3000 IFCX>CYTHENCZ=CX:CX=CY:CY=CZ
  50. 3010 CZ=CY-CX+1
  51. 3020 GOSUB19000
  52. 3030 FORI=CXTOHI-CZ
  53. 3040 T$(I)=T$(I+CZ)
  54. 3050 NEXTI:T$(I)="[138]":CX=0:J=I+1
  55. 3055 FORI=JTOJ+CZ+2:T$(I)="":NEXTI
  56. 3060 GOSUB19000:GOTO5745
  57. 4000 PRINT"[204][146]OAD","[211][146]AVE":PRINT" <SH[146]>-[211]POOL FILE"
  58. 4017 PRINT"[208][146]URGE","[195][146]ATALOG"
  59. 4020 GOSUB18000:M$=A$
  60. 4022 FK$="@W/":IFM$="[204]"ORM$="[211]"THENFK$="@S/":GOTO4040
  61. 4025 IFM$="C"THEN49000
  62. 4030 IFM$="P"THEN4970
  63. 4035 IFM$<>"S"ANDM$<>"L"THEN100
  64. 4040 IF(M$="S"ORM$="[211]")ANDHI=0THEN90
  65. 4050 PRINT"[212][146]APE","[196][146]ISK":GOSUB18000
  66. 4060 J=1:IFM$="L"THENINPUT"[211]TARTING ADDRESS  1[157][157][157]";J
  67. 4070 IFA$="D"THEN4600
  68. 4080 IFA$<>"T"THEN100
  69. 4170 IFM$="S"ORM$="[211]"THENAC=1
  70. 4200 PRINT"[212]APE READY?":GOSUB18000
  71. 4210 IFY1%>2THENPOKE144,85
  72. 4220 OPEN2,1,AC:GOTO4650
  73. 4600 IFDK%<>1THEN85
  74. 4610 PRINT"[198]ILENAME?":INPUT"  MISC[157][157][157][157][157][157]";FL$
  75. 4625 FM$=",S,W":IFM$="L"ORM$="[204]"THENFM$=",S,R"
  76. 4630 FL$=FK$+FL$+FM$
  77. 4640 OPEN2,8,2,FL$:GOSUB20000:IFE1<>0THEN85
  78. 4645 IFM$="[211]"THENRW=2:GOTO12010
  79. 4650 IFM$="L"ORM$="[204]"THEN4800
  80. 4660 FORI=1TOHI:PRINT#2,G$+T$(I)+G$
  81. 4664 PRINT"*";:NEXTI:GOTO100
  82. 4800 FORI=JTOET:INPUT#2,T$(I):IF(ST)AND64THEN100
  83. 4900 PRINT"*";:NEXTI:GOTO85
  84. 4970 PRINT"[193]RE YOU SURE? (Y/N)":GOSUB18000:IFA$<>"Y"THENPRINT"[193]BORTED":GOTO95
  85. 4980 FORI=1TOET:T$(I)="":NEXT:FORI=1TO4:C$(I)="":NEXT:GOTO90
  86. 5000 GOSUB19000:LG=FNA(0):AC=0
  87. 5010 PRINT"[147]"LG"[157]>";T$(LG)
  88. 5020 FORLB=1TO20:PRINT:PRINT:GOSUB10000:IFL<2ORHI+LB>ET-2THEN5200
  89. 5050 TR$(LB)=L$:NEXTLB
  90. 5200 LB=LB-1:IFLB=0THEN5745
  91. 5250 FORI=HI+LBTOLG+1+LBSTEP-1:T$(I)=T$(I-LB):NEXTI:J=0
  92. 5275 FORI=LG+1TOLG+LB:J=J+1:T$(I)=TR$(J):TR$(J)="":NEXTI:GOSUB19000:GOTO5745
  93. 5500 IFHI=0THEN90
  94. 5505 CX=0:INPUT"LINE #  1[157][157][157]";W3:Z6=1:Z5=1:JG$=""
  95. 5745 IFW3>HI-Y3%THENW3=HI-Y3%
  96. 5747 IFW3<1THENW3=1
  97. 5750 Z4=1:PRINT"[147]":FORI=W3TOW3+Y3%
  98. 5775 PRINTLEFT$(CD$,Z4);I"[157]";TAB(4)CHR$(34);T$(I);CHR$(34):Z4=Z4+Y2%
  99. 5800 NEXTI
  100. 5803 PRINTLEFT$(CD$,22);:IFY1%>1THENPRINT:PRINT
  101. 5805 PRINT"[195][210][211][210]>[146][197]DIT _[146][211]WAP [196][146]ELETE";:IFY1%>1THENPRINT
  102. 5807 PRINT"[201][146]NSERT [195][210][211][210][146]UP, DOWN";
  103. 5915 IFZ6<1THENZ6=1:W3=W3-1:GOTO5745
  104. 5925 IFZ6>Y4%THENZ6=Y4%:W3=W3+1:GOTO5745
  105. 5950 PRINTLEFT$(CD$,Z5)" [157] ";
  106. 5952 PRINTLEFT$(CD$,Z6)">[146]";:Z5=Z6
  107. 5955 GOSUB18000
  108. 5962 IFA$=""THENZ6=Z6+Y2%:GOTO5915
  109. 5965 IFA$=""THENPRINTTAB(2);:JG$=T$(FNA(0)):INPUTT$(FNA(0)):GOTO5745
  110. 5970 IFA$="[145]"THENZ6=Z6-Y2%:GOTO5915
  111. 5972 IFA$="D"ANDCX<>0THENCY=FNA(0):GOTO3000
  112. 5974 IFA$="D"THENCX=FNA(0)
  113. 5975 IFA$="I"THEN5000
  114. 5980 IFA$="_"ANDJG$<>""THENJH$=T$(FNA(0)):T$(FNA(0))=JG$:JG$=JH$:GOTO5745
  115. 5985 IFASC(A$)=13THEN100
  116. 5990 GOTO5955
  117. 6000 IFHI=0THEN90
  118. 6010 GOSUB17000
  119. 6020 TU=T1:T1=T7%:RW=1:IFI=4THENAC=1
  120. 6030 GOTO12010
  121. 6100 T1=TU:IFA$=""THEN100
  122. 6110 GOTO95
  123. 8000 PRINT"[147]"TAB(8)"ARE YOU SURE? (Y/N)"
  124. 8010 GET S$:IFS$=""THEN8010
  125. 8020 IF S$<>"Y"THEN100
  126. 8030 IF Y1%>2THENPOKE144,85
  127. 8040 RESTORE:CLR:SYS64738
  128. 10000 L$=""
  129. 10015 IFAC=13ORLL=1THENL$="_"
  130. 10020 PRINT"[164][157]";:L=LEN(L$)
  131. 10030 GOSUB18010:IFA$=""THENA$=SP$
  132. 10032 IFA$=SH$THENA$=S$
  133. 10035 AC=ASC(A$)
  134. 10040 IF(L>57ANDAC=32)ORL>72ORAC=13THENPRINTS$;:RETURN
  135. 10045 IF(AC=20ORAC=148)ANDL>1THENPRINT"";:L$=LEFT$(L$,L-1):GOTO10020
  136. 10050 IFAC=34THEN10020
  137. 10060 IF(AC>31ANDAC<96)OR(AC>192ANDAC<219)THENL$=L$+A$:PRINTA$;
  138. 10080 GOTO10020
  139. 11000 FORI=1TOHI:Y7$=T$(I):GOSUB13000:IFA$=""THENAC=1:PRINT"[193]BORTING"
  140. 11200 NEXTI:IFPG<>0THENFORPG=PG+1TO57:PRINT#4:NEXT:GOSUB13000
  141. 11210 IFAC=1THEN100
  142. 11220 PD=0:GOTO11000
  143. 12000 IFHI=0THEN90
  144. 12001 PRINT" [208][210][201][206][212]":PRINT"[206][146]EW DOCUMENT"
  145. 12002 PRINT"[195][146]ONTINUE OLD DOCUMENT":PRINT"[211][146]POOL FILE"
  146. 12003 RW=0:GOSUB18000:M$=A$:IFM$="C"THENGOSUB17000:GOTO12020
  147. 12004 IFM$<>"N"ANDM$<>"S"THEN100
  148. 12005 PG=0:PD=0:PRINT" [211]ET TO TOP-OF-FORM..  [210]EADY?"
  149. 12006 GOSUB18010:IFA$="[145]"THENPRINT#4:GOTO12006
  150. 12009 GOSUB17000:IFM$="S"THENRW=3:GOTO11000
  151. 12010 IFC$(1)=""THEN12020
  152. 12015 FORI=1TO7:Y7$=C$(I):IFI=3THENY7$=Y7$+","
  153. 12018 GOSUB13000:NEXT
  154. 12020 TL=HI:PH=0:I=1:T$=""
  155. 12030 IFLEN(T$)+LEN(T$(I)+S$)>245THEN12100
  156. 12040 IF(LEFT$(T$(I),1)="_"ANDI<>1)ORI>TLTHENPH=1:GOTO12100
  157. 12050 T$=T$+T$(I)+S$:I=I+1
  158. 12060 GOTO12030
  159. 12100 IFLEFT$(T$,1)="_"THENT$=SP$+MID$(T$,2)
  160. 12110 FORJ=T1TO1STEP-1
  161. 12120 IFMID$(T$,J,1)=S$THENT1$=LEFT$(T$,J-1):T$=MID$(T$,J+1):GOTO12200
  162. 12130 NEXTJ:T1$=LEFT$(T$,T1-1):T$=MID$(T$,T1)
  163. 12200 IFMG=1AND(RW<>1ORAC=1)THENGOSUB14000
  164. 12220 Y7$=T1$:GOSUB13000:T1$=""
  165. 12225 IFDT=1THENGOSUB13000
  166. 12227 IFA$=""THEN12300
  167. 12230 IFLEN(T$)>T1THEN12110
  168. 12240 IFPH=1ANDT$=""THEN12245
  169. 12242 GOTO12250
  170. 12245 PH=0:IFDT=0THENGOSUB13000
  171. 12247 IFI=<TLTHEN12050
  172. 12250 IFPH=1THEN12110
  173. 12260 IFI>TLTHEN12300
  174. 12270 GOTO12030
  175. 12300 ONRWGOTO6100,100
  176. 12310 PRINT"[212]OP-OF-FORM? ([217]/[206])":GOSUB18000:IFA$<>"Y"THEN100
  177. 12320 IFPG=0THEN100
  178. 12330 GOSUB13000:GOTO12320
  179. 13000 IFRW=2THEN13800
  180. 13005 GETA$:IFA$=""THENGOSUB18010
  181. 13010 IFRW=3THEN13050
  182. 13015 IFRW=1THENPRINTY7$:Y7$="":RETURN
  183. 13020 Y7$=LEFT$(SQ$,SP)+Y7$
  184. 13050 PRINT#4,Y7$:Y7$=""
  185. 13100 PG=PG+1:IFPG<58THENRETURN
  186. 13125 PD=PD+1:PD$="("+MID$(STR$(PD),2)+")"
  187. 13150 PRINT#4:PRINT#4,""TAB(65)PD$
  188. 13200 FORJ=1TO6:PRINT#4:NEXTJ:PG=0
  189. 13700 RETURN
  190. 13800 Y7$=LEFT$(SQ$,SP)+Y7$:IFY7$=""THENY7$=S$
  191. 13900 PRINT#2,G$+Y7$+G$:Y7$="":RETURN
  192. 14000 J5=1:T8=T1-LEN(T1$):J=1:MD=0:IFT8>25THENT8=25
  193. 14050 MD$=MID$(T1$,J,1)
  194. 14075 IFMD$<>S$THENMD=1
  195. 14085 IFMD$=S$ANDMD=0THEN14200
  196. 14150 IFMD$=S$THENT1$=LEFT$(T1$,J)+MID$(T1$,J):J=J+1:J5=J5+1:IFJ5>T8THENRETURN
  197. 14200 J=J+1:IFJ>LEN(T1$)THENRETURN
  198. 14225 GOTO14050
  199. 17000 PRINT"[195][210][211][210]>[146] [208]AUSE":PRINT"[195][210][211][210]V[146] [193]BORT"
  200. 17100 PRINT"-----------------":RETURN
  201. 18000 FORIK=1TO10:GETA$:NEXTIK
  202. 18010 GETA$:IFA$=""THEN18010
  203. 18020 RETURN
  204. 19000 FORI=1TOET-2:IFT$(I)="[138]"THEN19020
  205. 19007 IFT$(I)=""THENIFT$(I+1)=""ANDT$(I+2)=""THENT$(I)="[138]":GOTO19020
  206. 19010 NEXTI
  207. 19020 HI=I-1:LL=I:RETURN
  208. 20000 IFEE=0THENEE=15:OPENEE,8,EE
  209. 20010 INPUT#EE,E1,E2$,E3,E4
  210. 20020 IFE1=0THENRETURN
  211. 20030 PRINTE1;E2$;E3;E4:RETURN
  212. 21000 PRINT"[147]"CD$TAB(YT%)"* [196]EFAULT";
  213. 21020 PRINT"[205]ARGINS:"
  214. 21022 PRINT"*[206][146]ONE"
  215. 21025 PRINT" [211][146]MALL","(1/2 INCH)"
  216. 21030 PRINT" [204][146]ARGE","(1.5 INCH)":GOSUB18000:T1=79:SP=0
  217. 21060 IFA$="S"THENT1=72:SP=4
  218. 21075 IFA$="L"THENT1=63:SP=8
  219. 21100 PRINT"[210]IGHT-JUSTIFICATION?  (*[217]/[206])":MG=1
  220. 21120 GOSUB18000:IFA$="N"THENMG=0
  221. 21200 PRINT"[196]OUBLE SPACE?":PRINT" [217][146]ES":PRINT" [206][146]O":DT=0
  222. 21220 PRINT"*[194][146]ETWEEN PARAGRAPHS":GOSUB18000:IFA$="Y"THENDT=1
  223. 21230 IFA$="N"THENDT=2
  224. 21250 IFY1%>2THEN100
  225. 21300 PRINT"[210]EPEATING KEYS? ([217]/*[206])":GOSUB18000
  226. 21350 POKE650,0:IFA$="Y"THENPOKE650,128
  227. 21500 GOTO100
  228.