home *** CD-ROM | disk | FTP | other *** search
/ 64'er Special 4 / 64er_Magazin_Sonderheft_04_86-04_1986_Markt__Technik_de_Disk_1_of_2_Side_A.d64 / rel.dat.editor (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  11KB  |  343 lines

  1. 0 rem *********************************
  2. 1 rem *     texteditor v.iii.4        *
  3. 2 rem *         <c> 1985              *
  4. 3 rem *     von michael nickles       *
  5. 4 rem *********************************
  6. 8 ifim=1thenpoke648,204:poke53272,56:poke56576,0:print"[147]":goto20
  7. 9 poke53280,0:poke53281,0:print"[147]";
  8. 10 m%=300:dim m$(m%),m(m%):rem puffer
  9. 15 dimlg(100),rg(100)     :rem q.sort
  10. 19 rem anfangsmenue ------------------------------------------------------------
  11. 20 print"[147]        texteditor - version 3          [146]";
  12. 21 print"    <c> 1985 von michael nickles        [146]";
  13. 22 print"     alte datei editieren  -  'a'
  14. 23 [153]"     neue datei eroeffnen  -  'n'
  15. 24 print"     d.z.satz laden        -  'd'
  16. 25 [161]i$:[139][194](203)[178]1[167]i$[178]"a"
  17. 26 [139]i$[179][177]"a"[175]i$[179][177]"n"[175]i$[179][177]"d"[167]25
  18. 27 [139]i$[178]"d"[167]im[178]1:[147]"d.z.satz",8,1
  19. 28 [151]198,0:[133]"dateiname  *cmdcmdcmd";d$:[151]198,0
  20. 29 [133]"satzlaenge  40cmdcmdcmdcmd";sl:[139]sl[179]1[176]sl[177]254[167][153]"geht nicht !":[137]30
  21. 30 [139]i$[178]"a"[167]40
  22. 31 [133]"satzanzahl ";sn:hb[178][181](sn[173]255):lb[178]sn[171]hb[172]255
  23. 32 [153]"bitte leere disk einlegen <return>":[151]198,0:[146]198,1
  24. 33 [159]15,8,15
  25. 35 [152]15,"i0":[159]1,8,3,d$[170]",l,"[170][199](sl)
  26. 36 [152]15,"p";[199](3);[199](lb);[199](hb);[199](1)
  27. 37 [152]1,[199](255)
  28. 38 [160]1:[160]15
  29. 40 [159] 15,8,15
  30. 41 [152]15,"i0":[159] 1,8,3,d$:[153]
  31. 50 [143] zwischenmenue -----------------------------------------------------------
  32. 51 [153]"s / l / v / o / d / i / z / f / ende    wait";
  33. 52 [161]i$:[139]i$[178]""[167]52
  34. 53 [139]i$[178]"e"[167][153]"load";:[137]9900
  35. 54 [139]i$[178]"v"[167][153]"load";:[137]6000
  36. 55 [139]i$[178]"o"[167][153]"load";:[137]10000
  37. 56 [139]i$[178]"d"[167][153]"load";:[137]7000
  38. 57 [139]i$[178]"i"[167][153]"load";:[137]30000
  39. 58 [139]i$[178]"z"[167][153]"load";:[137]8000
  40. 59 [139]i$[178]"f"[167][153]"load";:[137]61000
  41. 60 [139]i$[179][177]"s"[175]i$[179][177]"l"[167]52
  42. 61 [133]"satznr";sa:[139] sa[179]0 [176] sa[177]63000 [167]60
  43. 64 [139]i$[178]"l"[167][153]"load";:[137]2000
  44. 66 [139]i$[178]"s"[167][153]"load";:mo[178]1:[137]3000
  45. 70 [137] 50
  46. 2000 [143] lesen -----------------------------------------------------------------
  47. 2001 :[153]"load";sa;"cmd-";[196](sa[170]20);" wait"
  48. 2005 ia[178]sa
  49. 2007 [129] sa[178]ia [164] ia[170]20
  50. 2010 : [141]9000:[141]9100
  51. 2025 : [139]a[178]50[167]sa[178]ia[170]21:[137]2045
  52. 2030 : [139][195](a$)[179]40[167][153]a$
  53. 2035 : [139][195](a$)[177][178]40[167][153]a$;
  54. 2045 [130]:[153]
  55. 2046 [139]a[178]50[167][153]"satznummer zu hoch!"
  56. 2050 [137] 50
  57. 3000 [143] schreiben -------------------------------------------------------------
  58. 3005 [153]"eingabesatz  //=keine eingabe"
  59. 3010 [141]9000   :[143] positionieren
  60. 3020 [139]a[178]50[167][153]"satznummer zu hoch!":[137]50             :[143] fehlerkanalabfr.
  61. 3030 [141]50000:a$[178]be$                                   :[143] input-rout.
  62. 3040 [139]a$[178]"//"[167]mo[178]0:[137]50:[143] ende
  63. 3050 [141]9200   :[143] a$ schreiben
  64. 3060 sa[178]sa[170]1     :[143] naechster satz
  65. 3070 [137]3010    :[143] next (loop)
  66. 6000 [143] versetzen -------------------------------------------------------------
  67. 6002 [153]"loadversetzenwait"
  68. 6010 [153]"bitte geben sie anfang und ende des be- reiches an, den sie ";
  69. 6015 [153]"versetzen wollen !"
  70. 6020 [151]198,0:[133]"anfang";an
  71. 6021 [151]198,0:[133]"ende";en:[139]an[177]en[167][153]"das ist unsinn !":[137]6020
  72. 6023 sa[178]an:[141]9000:[139]a[178]50[167][153]"anfangssatz existiert nicht!":[137]50
  73. 6024 sa[178]en:[141]9000:[139]a[178]50[167][153]"endsatz zu hoch!":[137]50
  74. 6026 [153]"quelldatei = ";d$
  75. 6028 [151]198,0:[133]"zieldatei ";z$:[139] z$[178]""[167] z$[178]d$:[153]"on";d$
  76. 6029 [153]"bitte anfang des neuen bereichs angeben!";:[151]198,0:[133]nb:[153]
  77. 6030 sa[178]nb:[141]9000:[139]a[178]50[167][153]"neuer anfangssatz zu hoch!":[137]50
  78. 6031 sa[178]nb[170]en[171]an:[141]9000:[139]a[178]50[167][153]"bereich zu gross!":[137]50
  79. 6032 [153]"bitte warten!"
  80. 6036 sa[178]an:im[178]0:[139]an[178]en[167][153]"*** fertig ***":[151]198,0:[146]198,1:[137]50
  81. 6038 [141]9000:[141]9100:[139]a[178]50[167]6100
  82. 6040 m$(sa[171]an)[178]a$
  83. 6045 [139]sa[178]en[167]6100
  84. 6050 [139]sa[171]an[178]m%[167]im[178]1:[137]6100:[143] *
  85. 6060 sa[178]sa[170]1:[137]6038
  86. 6100 [143] transport
  87. 6110 [153]"bitte disk mit zieldatei einlegen !":[151]198,0:[146]198,1
  88. 6120 [160]1:[152]15,"i0":[159]1,8,3,z$
  89. 6200 sa[178]nb:[141]9000:[139]a[178]50[167]50
  90. 6205 ii[178]en[171]an:[139]im[178]1[167]ii[178]m%:[143] *
  91. 6215 [129]i[178]0[164]ii
  92. 6220 a$[178]m$(i):[139]a$[178]""[167]a$[178]":"
  93. 6225 [141]9200:[143] schreiben
  94. 6240 sa[178]sa[170]1:[130]i:[139]im[179][177]0[167]6260
  95. 6250 [153]"bitte disk mit quelldatei einlegen !":[151]198,0:[146]198,1:[137]50
  96. 6260 an[178]an[170]m%:nb[178]nb[170]m%:[153]"bitte disk mit quelldatei einlegen !"
  97. 6270 [151]198,0:[146]198,1:[160]1:[152]15,"i0":[159]1,8,3,d$:[137]6036:[143] *
  98. 7000 [143] printer-routine -------------------------------------------------------
  99. 7001 [153]"loadprinter-routine mps 801wait
  100. 7002 input"anfang";an:input"ende";en:ifan>enthen7000
  101. 7005 sa=an:gosub9000:ifa=50thenprint"anfangssatz existiert nicht!":goto50
  102. 7006 sa=en:gosub9000:ifa=50thenprint"endsatz zu hoch!":goto50
  103. 7009 an=an-1:print"bitte waehlen sie:
  104. 7010 [153],"normale ausgabe ..1
  105. 7011 print,"d.z.s. ausgabe ...2
  106. 7012 [153],"eigene routine ...3
  107. 7013 geti$:ifval(i$)<1orval(i$)>3then7013
  108. 7014 ifi$="2"then7100
  109. 7015 ifi$="3"then7500
  110. 7020 rem normale ausgabe --------------
  111. 7021 open3,4,7:forsa=antoen:gosub9000:gosub9100
  112. 7025 ifa=50thenprint"satznummer zu hoch!":sa=en+1:goto7045
  113. 7035 print#3,right$("   "+str$(sa),3);"    ";
  114. 7036 fori=1tolen(a$)
  115. 7037 :ifmid$(a$,i,1)=""thenprint#3," ";:goto7040
  116. 7038 :print#3,mid$(a$,i,1);
  117. 7040 nexti:print#3
  118. 7045 nextsa:close3:print:goto50
  119. 7100 rem d.z.satz ausgabe -------------
  120. 7101 open3,4,7:forsa=antoen:gosub9000:gosub9100
  121. 7102 ifa=50thensa=en+1:print"satznummer zu hoch!":goto7170
  122. 7110 print#3,right$("    "+str$(sa),4);"    ";
  123. 7120 fori=1tolen(a$):ifa$=""then7160
  124. 7125 im=asc(mid$(a$,i,1))
  125. 7126 ifim>64andim<91orim>96andim<123then7160
  126. 7130 ifim=64thenprint#3,chr$(34);:goto7170
  127. 7135 ifim=173thenprint#3,"[193]e";:goto7170
  128. 7140 ifim=174thenprint#3,"ss";:goto7170
  129. 7145 ifim=176thenprint#3,"ae";:goto7170
  130. 7150 ifim=181thenprint#3,"[213]e";:goto7170
  131. 7152 ifim=182thenprint#3,"[207]e";:goto7170
  132. 7154 ifim=184thenprint#3,"ue";:goto7170
  133. 7156 ifim=185thenprint#3,"oe";:goto7170
  134. 7158 ifim=94thenprint#3,":";  :goto7170
  135. 7159 ifim=95thenprint#3,",";  :goto7170
  136. 7160 print#3,chr$(im);
  137. 7170 nexti:print#3,chr$(13);
  138. 7175 nextsa:close3:print:goto50
  139. 7500 rem eigene routine ---------------
  140. 7510 print"sie haben noch keine eigene printer-    routine deffiniert!":goto50
  141. 8000 rem text zentrieren -------------------------------------------------------
  142. 8001 i$="":fori=1to10:i$=i$+"":nexti
  143. 8002 remsl=27
  144. 8005 remdimm$(300):goto8100
  145. 8010 print"zentrieren[146]"
  146. 8015 print"bitte geben sie anfang und ende des     bereiches an, der zentriert";
  147. 8017 print" werden soll!"
  148. 8020 input"anfang";an:input"ende";en:ifan>enthen50
  149. 8025 sa=an:gosub9000:ifa=50thenprint"anfangssatz existiert nicht!":goto50
  150. 8030 sa=en:gosub9000:ifa=50thenprint"endsatz zu hoch!":goto50
  151. 8040 print"links-rechts buendig zentrieren  - '1'
  152. 8045 [153]"in die mitte zentrieren          - '2'
  153. 8050 getii$:ifii$<>"1"andii$<>"2"then8050
  154. 8060 ifii$="2"then8600
  155. 8099 rem links-rechts buendig ---------
  156. 8100 print"bitte warten!"
  157. 8105 forsa=antoen
  158. 8110 : gosub9000:gosub9100:printa$:printlen(a$)
  159. 8120 : ifright$(a$,1)=chr$(29)thena$=left$(a$,len(a$)-1):goto8120
  160. 8122 : ifright$(a$,1)=chr$(32)thena$=left$(a$,len(a$)-1):goto8122
  161. 8123 : ifright$(a$,1)=chr$(160)thena$=left$(a$,len(a$)-1):goto8123
  162. 8130 : iflen(a$)=slthen8520
  163. 8200 :  lu=sl-len(a$):print"lu=";lu
  164. 8220 :  i=1:ic=0:rem begin loop -------
  165. 8222 :
  166. 8230 :   ifmid$(a$,i,1)=""ormid$(a$,i+1,1)=""then8530
  167. 8231 :   im=asc(mid$(a$,i,1))
  168. 8232 :   in=asc(mid$(a$,i+1,1))
  169. 8240 :   ifim<>29andim<>32andim<>160then8500
  170. 8250 :   ifin=29orin=32orin=160then8500
  171. 8260 :    a$=left$(a$,i)+" "+right$(a$,len(a$)-i)
  172. 8261 :   ifmid$(a$,i,1)=" "ormid$(a$,i,1)=""theni=i+1:goto8261
  173. 8265 :   lu=lu-1:iflu=0then8510
  174. 8266 :   ic=ic+1
  175. 8270 :   i=i+1
  176. 8400 :
  177. 8500 i=i+1
  178. 8505 ifi<len(a$)then8230
  179. 8510 ifi=len(a$)andlu>0andic<>0then8220
  180. 8520 gosub9000:gosub9200
  181. 8530 nextsa
  182. 8540 goto50
  183. 8600 rem in die mitte -----------------
  184. 8610 print"bitte warten!"
  185. 8620 forsa=antoen
  186. 8630 :gosub9000:gosub9100
  187. 8635 ifright$(a$,1)=chr$(29)thena$=left$(a$,len(a$)-1):goto8635
  188. 8636 ifright$(a$,1)=chr$(32)thena$=left$(a$,len(a$)-1):goto8636
  189. 8637 ifright$(a$,1)=chr$(160)thena$=left$(a$,len(a$)-1):goto8637
  190. 8640 :iflen(a$)=slthen8680
  191. 8650 :as=sl-len(a$): rem anzahl spaces
  192. 8660 :a$=left$(i$,as/2)+a$
  193. 8670 :gosub9000:gosub9200
  194. 8680 nextsa
  195. 8690 goto50
  196. 9000 rem positionieren ****************
  197. 9010 hb%=sa/256:lb%=sa-hb%*256
  198. 9020 print#15,"p";chr$(3);chr$(lb%);chr$(hb%);chr$(1)
  199. 9030 input#15,a
  200. 9040 return
  201. 9100 rem satz einlesen ****************
  202. 9110 ifa=50thenreturn
  203. 9120 input#1,a$
  204. 9140 return
  205. 9200 rem satz schreiben ***************
  206. 9210 ifa=50thenreturn
  207. 9211 ifa$=""thena$=":":rem zur sicherheit !!!
  208. 9220 print#1,a$
  209. 9240 return
  210. 9900 rem beenden **********************
  211. 9910 close 1
  212. 9920 close 15
  213. 9930 print "++ ende ++"
  214. 9940 end
  215. 10000 rem sort-alogarithmus ----------------------------------------------------
  216. 10010 print"[147]datei sortieren[146]"
  217. 10100 print"bitte geben sie anfang und ende des zu  sortierenden bereichs an !
  218. 10110 [133]"anfang";an
  219. 10120 [133]"ende";  en
  220. 10122 sa[178]an:[141]9000:[139]a[178]50[167][153]"anfangssatz existiert nicht!":[137]50
  221. 10124 sa[178]en:[141]9000:[139]a[178]50[167][153]"endsatz zu hoch!":[137]50
  222. 10130 [139]en[171]an[177]m%[167][153]"bereich zu gross!":[137]50
  223. 10135 [153]"bitte markieren sie den bereich inner-
  224. 10136 print"halb der strings nach dem die sortierung";
  225. 10137 print"erfolgen soll!"
  226. 10138 sa=an:gosub9000:gosub9100:ifa=50thenprint"satz existiert nicht!":goto50
  227. 10139 ig=-1:gosub60000:ig=0
  228. 10140 ic=0:forsa=antoen:ic=ic+1
  229. 10145 :gosub9000:gosub9100:ifa=50thenprint"satznummer zu hoch!":sa=en+1:goto1015
  230. 10146 :m$(ic)=a$
  231. 10150 nextsa
  232. 10180 z=0:lg(1)=1:rg(1)=en-an+1
  233. 10190 gosub10200:goto10400
  234. 10200 rem  quicksort -----------------
  235. 10210 z=z+1:iflg(z)>=rg(z)then10350
  236. 10220 x=lg(z):y=rg(z)
  237. 10230 vg$=mid$(m$(int((x+y)/2)),ma(1),mb(1)-ma(1)+1)
  238. 10240 if x>y then10330
  239. 10250 if mid$(m$(x),ma(1),mb(1)-ma(1)+1)<vg$thenx=x+1:goto10250
  240. 10260 if mid$(m$(y),ma(1),mb(1)-ma(1)+1)>vg$theny=y-1:goto10260
  241. 10270 if x>ythen10330
  242. 10280 s$=m$(x):m$(x)=m$(y):m$(y)=s$
  243. 10290 x=x+1:y=y-1:goto10240
  244. 10330 rg(z+1)=y:lg(z+1)=lg(z):gosub10210
  245. 10340 lg(z+1)=x:rg(z+1)=rg(z):gosub10210
  246. 10350 z=z-1:return
  247. 10400 rem abspeichern
  248. 10410 ic=0:forsa=antoen:ic=ic+1
  249. 10420 :gosub9000:a$=m$(ic):gosub9200
  250. 10430 nextsa
  251. 10500 goto50
  252. 20000 rem korrektur-routine ----------------------------------------------------
  253. 20001 fori=0tolen(be$):printchr$(20);:nexti:be$=""
  254. 20010 sa=sa+sc       : rem textzeiger
  255. 20015 ifsa<0thensa=0 : rem sperre
  256. 20020 gosub 9000     : rem positionieren
  257. 20025 ifa=50thensa=sa-sc:goto20020
  258. 20040 input#1,a$
  259. 20060 return
  260. 30000 rem directory einlesen ---------------------------------------------------
  261. 30010 print"[147]inhaltsverzeichnis:[146]"
  262. 30110 print#15,"io":open2,8,2,"#"
  263. 30120 t=18:s=1
  264. 30130 print#15,"u1";2;0;t;s
  265. 30140 print#15,"b-p";2;0
  266. 30150 get#2,x$:ifx$=""thenx$=chr$(0)
  267. 30160 t=asc(x$)
  268. 30170 get#2,x$:ifx$=""thenx$=chr$(0)
  269. 30180 s=asc(x$)
  270. 30190 forx=0to7
  271. 30192 print#15,"b-p";2;x*32+2
  272. 30194 get#2,x$:ifx$=""thenx$=chr$(0)
  273. 30196 ifasc(x$)=0then30290
  274. 30200 print#15,"b-p";2;x*32+5
  275. 30210 ff$=""
  276. 30220 fory=0to15
  277. 30230 get#2,x$:ifx$=""thenx$=chr$(0)
  278. 30240 ifasc(x$)=160then30270
  279. 30250 ff$=ff$+x$
  280. 30260 nexty
  281. 30270 ifa=0thena=1:printff$;:goto30290
  282. 30280 a=0:printtab(19);"[167] ";ff$
  283. 30290 nextx
  284. 30300 ift<>0then30130
  285. 30310 close2:print
  286. 30330 goto50
  287. 50000 rem texteingabe ----------------------------------------------------------
  288. 50002 ifar=1thenar=0:a$="satznummer zu hoch![146]":goto50007
  289. 50006 gosub9000:gosub9100
  290. 50007 print"                                        ";:print"satz";sa;"[146]"
  291. 50008 print"                                        [145]";a$
  292. 50009 print"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]";
  293. 50010 print""
  294. 50020 be$="":poke198,0:poke211,0:poke214,22:sys58732:print"[158][164]";
  295. 50030 getx$:ifpeek(203)=1then50120
  296. 50035 if peek(203)=7andpeek(653)=0 then sc=1 : gosub 20000 : goto 50000
  297. 50037 if peek(203)=7andpeek(653)=1 then sc=-1 : gosub 20000 : goto 50000
  298. 50040 ifx$=""then50030
  299. 50050 iflen(be$)=0andasc(x$)=20then50030
  300. 50060 i=asc(x$):ifi<32ori>133andi<159thenifi<>20then50030
  301. 50070 iflen(be$)=slandi<>20then50030
  302. 50075 ifx$=" "thenx$=""
  303. 50080 be$=be$+x$
  304. 50090 printchr$(20);x$;"[164]";
  305. 50100 ifi=20thenbe$=left$(be$,len(be$)-2):goto50030
  306. 50110 goto50030
  307. 50120 print"[157] ":gosub9000
  308. 50130 ifbe$=""thenbe$=":"
  309. 50140 print"":return
  310. 60000 rem markieren wie datiert wird -------------------------------------------
  311. 60010 i$=a$:fori=1tolen(i$):m$(i)="0":next
  312. 60020 im=1:print
  313. 60025 printi$:fori=1tolen(i$):printm$(i);:next:print
  314. 60030 print"edit   >";mid$(i$,im,1);"<    "im"[146]"
  315. 60035 i=peek(203):ifi=64then60035
  316. 60040 ifi=2andpeek(653)=0andim<>len(i$)thenim=im+1:goto60070
  317. 60042 ifi=2andpeek(653)=1andim<>1thenim=im-1:goto60070
  318. 60045 ifi=56thenm$(im)="1":goto60070
  319. 60055 ifi=35thenm$(im)="0":goto60070
  320. 60056 ifi=1then60100
  321. 60060 goto60035
  322. 60070 print"[145]                         [157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][145][145][145]";:goto60025
  323. 60100 rem umrechnen
  324. 60102 fori=1to3:ma(i)=0:mb(i)=0:nexti
  325. 60105 forii=1to3
  326. 60110 :fori=1tolen(i$):ifma(ii)=0andm$(i)=right$(str$(ii),1)thenma(ii)=i
  327. 60113 nexti
  328. 60115 :ifma(ii)=0then60150
  329. 60120 :   mb(ii)=ma(ii)
  330. 60125 :   mb(ii)=mb(ii)+1:remprint,mb(ii)
  331. 60130 :   ifm$(mb(ii))<>right$(str$(ii),1)thenmb(ii)=mb(ii)-1:goto60150
  332. 60135 :   ifmb(ii)=len(i$)then60150
  333. 60140 :   goto60125
  334. 60150 nextii
  335. 60170 print"die sortierung erfolgt nach folgendem   stringbereich:"
  336. 60180 print""mid$(i$,ma(1),mb(1)-ma(1)+1)"[146]"
  337. 60190 return
  338. 61000 rem floppy-fehlerkanal lesen ---------------------------------------------
  339. 61005 print"[147]floppy-fehlerkanalabfrage[146]"
  340. 61010 input#15,a,b$,c,d
  341. 61020 printa,b$,c,d
  342. 61040 goto50
  343.