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 >
Wrap
Commodore BASIC
|
2022-10-26
|
11KB
|
343 lines
0 rem *********************************
1 rem * texteditor v.iii.4 *
2 rem * <c> 1985 *
3 rem * von michael nickles *
4 rem *********************************
8 ifim=1thenpoke648,204:poke53272,56:poke56576,0:print"[147]":goto20
9 poke53280,0:poke53281,0:print"[147]";
10 m%=300:dim m$(m%),m(m%):rem puffer
15 dimlg(100),rg(100) :rem q.sort
19 rem anfangsmenue ------------------------------------------------------------
20 print"[147] texteditor - version 3 [146]";
21 print" <c> 1985 von michael nickles [146]";
22 print" alte datei editieren - 'a'
23 [153]" neue datei eroeffnen - 'n'
24 print" d.z.satz laden - 'd'
25 [161]i$:[139][194](203)[178]1[167]i$[178]"a"
26 [139]i$[179][177]"a"[175]i$[179][177]"n"[175]i$[179][177]"d"[167]25
27 [139]i$[178]"d"[167]im[178]1:[147]"d.z.satz",8,1
28 [151]198,0:[133]"dateiname *cmdcmdcmd";d$:[151]198,0
29 [133]"satzlaenge 40cmdcmdcmdcmd";sl:[139]sl[179]1[176]sl[177]254[167][153]"geht nicht !":[137]30
30 [139]i$[178]"a"[167]40
31 [133]"satzanzahl ";sn:hb[178][181](sn[173]255):lb[178]sn[171]hb[172]255
32 [153]"bitte leere disk einlegen <return>":[151]198,0:[146]198,1
33 [159]15,8,15
35 [152]15,"i0":[159]1,8,3,d$[170]",l,"[170][199](sl)
36 [152]15,"p";[199](3);[199](lb);[199](hb);[199](1)
37 [152]1,[199](255)
38 [160]1:[160]15
40 [159] 15,8,15
41 [152]15,"i0":[159] 1,8,3,d$:[153]
50 [143] zwischenmenue -----------------------------------------------------------
51 [153]"s / l / v / o / d / i / z / f / ende wait";
52 [161]i$:[139]i$[178]""[167]52
53 [139]i$[178]"e"[167][153]"load";:[137]9900
54 [139]i$[178]"v"[167][153]"load";:[137]6000
55 [139]i$[178]"o"[167][153]"load";:[137]10000
56 [139]i$[178]"d"[167][153]"load";:[137]7000
57 [139]i$[178]"i"[167][153]"load";:[137]30000
58 [139]i$[178]"z"[167][153]"load";:[137]8000
59 [139]i$[178]"f"[167][153]"load";:[137]61000
60 [139]i$[179][177]"s"[175]i$[179][177]"l"[167]52
61 [133]"satznr";sa:[139] sa[179]0 [176] sa[177]63000 [167]60
64 [139]i$[178]"l"[167][153]"load";:[137]2000
66 [139]i$[178]"s"[167][153]"load";:mo[178]1:[137]3000
70 [137] 50
2000 [143] lesen -----------------------------------------------------------------
2001 :[153]"load";sa;"cmd-";[196](sa[170]20);" wait"
2005 ia[178]sa
2007 [129] sa[178]ia [164] ia[170]20
2010 : [141]9000:[141]9100
2025 : [139]a[178]50[167]sa[178]ia[170]21:[137]2045
2030 : [139][195](a$)[179]40[167][153]a$
2035 : [139][195](a$)[177][178]40[167][153]a$;
2045 [130]:[153]
2046 [139]a[178]50[167][153]"satznummer zu hoch!"
2050 [137] 50
3000 [143] schreiben -------------------------------------------------------------
3005 [153]"eingabesatz //=keine eingabe"
3010 [141]9000 :[143] positionieren
3020 [139]a[178]50[167][153]"satznummer zu hoch!":[137]50 :[143] fehlerkanalabfr.
3030 [141]50000:a$[178]be$ :[143] input-rout.
3040 [139]a$[178]"//"[167]mo[178]0:[137]50:[143] ende
3050 [141]9200 :[143] a$ schreiben
3060 sa[178]sa[170]1 :[143] naechster satz
3070 [137]3010 :[143] next (loop)
6000 [143] versetzen -------------------------------------------------------------
6002 [153]"loadversetzenwait"
6010 [153]"bitte geben sie anfang und ende des be- reiches an, den sie ";
6015 [153]"versetzen wollen !"
6020 [151]198,0:[133]"anfang";an
6021 [151]198,0:[133]"ende";en:[139]an[177]en[167][153]"das ist unsinn !":[137]6020
6023 sa[178]an:[141]9000:[139]a[178]50[167][153]"anfangssatz existiert nicht!":[137]50
6024 sa[178]en:[141]9000:[139]a[178]50[167][153]"endsatz zu hoch!":[137]50
6026 [153]"quelldatei = ";d$
6028 [151]198,0:[133]"zieldatei ";z$:[139] z$[178]""[167] z$[178]d$:[153]"on";d$
6029 [153]"bitte anfang des neuen bereichs angeben!";:[151]198,0:[133]nb:[153]
6030 sa[178]nb:[141]9000:[139]a[178]50[167][153]"neuer anfangssatz zu hoch!":[137]50
6031 sa[178]nb[170]en[171]an:[141]9000:[139]a[178]50[167][153]"bereich zu gross!":[137]50
6032 [153]"bitte warten!"
6036 sa[178]an:im[178]0:[139]an[178]en[167][153]"*** fertig ***":[151]198,0:[146]198,1:[137]50
6038 [141]9000:[141]9100:[139]a[178]50[167]6100
6040 m$(sa[171]an)[178]a$
6045 [139]sa[178]en[167]6100
6050 [139]sa[171]an[178]m%[167]im[178]1:[137]6100:[143] *
6060 sa[178]sa[170]1:[137]6038
6100 [143] transport
6110 [153]"bitte disk mit zieldatei einlegen !":[151]198,0:[146]198,1
6120 [160]1:[152]15,"i0":[159]1,8,3,z$
6200 sa[178]nb:[141]9000:[139]a[178]50[167]50
6205 ii[178]en[171]an:[139]im[178]1[167]ii[178]m%:[143] *
6215 [129]i[178]0[164]ii
6220 a$[178]m$(i):[139]a$[178]""[167]a$[178]":"
6225 [141]9200:[143] schreiben
6240 sa[178]sa[170]1:[130]i:[139]im[179][177]0[167]6260
6250 [153]"bitte disk mit quelldatei einlegen !":[151]198,0:[146]198,1:[137]50
6260 an[178]an[170]m%:nb[178]nb[170]m%:[153]"bitte disk mit quelldatei einlegen !"
6270 [151]198,0:[146]198,1:[160]1:[152]15,"i0":[159]1,8,3,d$:[137]6036:[143] *
7000 [143] printer-routine -------------------------------------------------------
7001 [153]"loadprinter-routine mps 801wait
7002 input"anfang";an:input"ende";en:ifan>enthen7000
7005 sa=an:gosub9000:ifa=50thenprint"anfangssatz existiert nicht!":goto50
7006 sa=en:gosub9000:ifa=50thenprint"endsatz zu hoch!":goto50
7009 an=an-1:print"bitte waehlen sie:
7010 [153],"normale ausgabe ..1
7011 print,"d.z.s. ausgabe ...2
7012 [153],"eigene routine ...3
7013 geti$:ifval(i$)<1orval(i$)>3then7013
7014 ifi$="2"then7100
7015 ifi$="3"then7500
7020 rem normale ausgabe --------------
7021 open3,4,7:forsa=antoen:gosub9000:gosub9100
7025 ifa=50thenprint"satznummer zu hoch!":sa=en+1:goto7045
7035 print#3,right$(" "+str$(sa),3);" ";
7036 fori=1tolen(a$)
7037 :ifmid$(a$,i,1)=""thenprint#3," ";:goto7040
7038 :print#3,mid$(a$,i,1);
7040 nexti:print#3
7045 nextsa:close3:print:goto50
7100 rem d.z.satz ausgabe -------------
7101 open3,4,7:forsa=antoen:gosub9000:gosub9100
7102 ifa=50thensa=en+1:print"satznummer zu hoch!":goto7170
7110 print#3,right$(" "+str$(sa),4);" ";
7120 fori=1tolen(a$):ifa$=""then7160
7125 im=asc(mid$(a$,i,1))
7126 ifim>64andim<91orim>96andim<123then7160
7130 ifim=64thenprint#3,chr$(34);:goto7170
7135 ifim=173thenprint#3,"[193]e";:goto7170
7140 ifim=174thenprint#3,"ss";:goto7170
7145 ifim=176thenprint#3,"ae";:goto7170
7150 ifim=181thenprint#3,"[213]e";:goto7170
7152 ifim=182thenprint#3,"[207]e";:goto7170
7154 ifim=184thenprint#3,"ue";:goto7170
7156 ifim=185thenprint#3,"oe";:goto7170
7158 ifim=94thenprint#3,":"; :goto7170
7159 ifim=95thenprint#3,","; :goto7170
7160 print#3,chr$(im);
7170 nexti:print#3,chr$(13);
7175 nextsa:close3:print:goto50
7500 rem eigene routine ---------------
7510 print"sie haben noch keine eigene printer- routine deffiniert!":goto50
8000 rem text zentrieren -------------------------------------------------------
8001 i$="":fori=1to10:i$=i$+"":nexti
8002 remsl=27
8005 remdimm$(300):goto8100
8010 print"zentrieren[146]"
8015 print"bitte geben sie anfang und ende des bereiches an, der zentriert";
8017 print" werden soll!"
8020 input"anfang";an:input"ende";en:ifan>enthen50
8025 sa=an:gosub9000:ifa=50thenprint"anfangssatz existiert nicht!":goto50
8030 sa=en:gosub9000:ifa=50thenprint"endsatz zu hoch!":goto50
8040 print"links-rechts buendig zentrieren - '1'
8045 [153]"in die mitte zentrieren - '2'
8050 getii$:ifii$<>"1"andii$<>"2"then8050
8060 ifii$="2"then8600
8099 rem links-rechts buendig ---------
8100 print"bitte warten!"
8105 forsa=antoen
8110 : gosub9000:gosub9100:printa$:printlen(a$)
8120 : ifright$(a$,1)=chr$(29)thena$=left$(a$,len(a$)-1):goto8120
8122 : ifright$(a$,1)=chr$(32)thena$=left$(a$,len(a$)-1):goto8122
8123 : ifright$(a$,1)=chr$(160)thena$=left$(a$,len(a$)-1):goto8123
8130 : iflen(a$)=slthen8520
8200 : lu=sl-len(a$):print"lu=";lu
8220 : i=1:ic=0:rem begin loop -------
8222 :
8230 : ifmid$(a$,i,1)=""ormid$(a$,i+1,1)=""then8530
8231 : im=asc(mid$(a$,i,1))
8232 : in=asc(mid$(a$,i+1,1))
8240 : ifim<>29andim<>32andim<>160then8500
8250 : ifin=29orin=32orin=160then8500
8260 : a$=left$(a$,i)+" "+right$(a$,len(a$)-i)
8261 : ifmid$(a$,i,1)=" "ormid$(a$,i,1)=""theni=i+1:goto8261
8265 : lu=lu-1:iflu=0then8510
8266 : ic=ic+1
8270 : i=i+1
8400 :
8500 i=i+1
8505 ifi<len(a$)then8230
8510 ifi=len(a$)andlu>0andic<>0then8220
8520 gosub9000:gosub9200
8530 nextsa
8540 goto50
8600 rem in die mitte -----------------
8610 print"bitte warten!"
8620 forsa=antoen
8630 :gosub9000:gosub9100
8635 ifright$(a$,1)=chr$(29)thena$=left$(a$,len(a$)-1):goto8635
8636 ifright$(a$,1)=chr$(32)thena$=left$(a$,len(a$)-1):goto8636
8637 ifright$(a$,1)=chr$(160)thena$=left$(a$,len(a$)-1):goto8637
8640 :iflen(a$)=slthen8680
8650 :as=sl-len(a$): rem anzahl spaces
8660 :a$=left$(i$,as/2)+a$
8670 :gosub9000:gosub9200
8680 nextsa
8690 goto50
9000 rem positionieren ****************
9010 hb%=sa/256:lb%=sa-hb%*256
9020 print#15,"p";chr$(3);chr$(lb%);chr$(hb%);chr$(1)
9030 input#15,a
9040 return
9100 rem satz einlesen ****************
9110 ifa=50thenreturn
9120 input#1,a$
9140 return
9200 rem satz schreiben ***************
9210 ifa=50thenreturn
9211 ifa$=""thena$=":":rem zur sicherheit !!!
9220 print#1,a$
9240 return
9900 rem beenden **********************
9910 close 1
9920 close 15
9930 print "++ ende ++"
9940 end
10000 rem sort-alogarithmus ----------------------------------------------------
10010 print"[147]datei sortieren[146]"
10100 print"bitte geben sie anfang und ende des zu sortierenden bereichs an !
10110 [133]"anfang";an
10120 [133]"ende"; en
10122 sa[178]an:[141]9000:[139]a[178]50[167][153]"anfangssatz existiert nicht!":[137]50
10124 sa[178]en:[141]9000:[139]a[178]50[167][153]"endsatz zu hoch!":[137]50
10130 [139]en[171]an[177]m%[167][153]"bereich zu gross!":[137]50
10135 [153]"bitte markieren sie den bereich inner-
10136 print"halb der strings nach dem die sortierung";
10137 print"erfolgen soll!"
10138 sa=an:gosub9000:gosub9100:ifa=50thenprint"satz existiert nicht!":goto50
10139 ig=-1:gosub60000:ig=0
10140 ic=0:forsa=antoen:ic=ic+1
10145 :gosub9000:gosub9100:ifa=50thenprint"satznummer zu hoch!":sa=en+1:goto1015
10146 :m$(ic)=a$
10150 nextsa
10180 z=0:lg(1)=1:rg(1)=en-an+1
10190 gosub10200:goto10400
10200 rem quicksort -----------------
10210 z=z+1:iflg(z)>=rg(z)then10350
10220 x=lg(z):y=rg(z)
10230 vg$=mid$(m$(int((x+y)/2)),ma(1),mb(1)-ma(1)+1)
10240 if x>y then10330
10250 if mid$(m$(x),ma(1),mb(1)-ma(1)+1)<vg$thenx=x+1:goto10250
10260 if mid$(m$(y),ma(1),mb(1)-ma(1)+1)>vg$theny=y-1:goto10260
10270 if x>ythen10330
10280 s$=m$(x):m$(x)=m$(y):m$(y)=s$
10290 x=x+1:y=y-1:goto10240
10330 rg(z+1)=y:lg(z+1)=lg(z):gosub10210
10340 lg(z+1)=x:rg(z+1)=rg(z):gosub10210
10350 z=z-1:return
10400 rem abspeichern
10410 ic=0:forsa=antoen:ic=ic+1
10420 :gosub9000:a$=m$(ic):gosub9200
10430 nextsa
10500 goto50
20000 rem korrektur-routine ----------------------------------------------------
20001 fori=0tolen(be$):printchr$(20);:nexti:be$=""
20010 sa=sa+sc : rem textzeiger
20015 ifsa<0thensa=0 : rem sperre
20020 gosub 9000 : rem positionieren
20025 ifa=50thensa=sa-sc:goto20020
20040 input#1,a$
20060 return
30000 rem directory einlesen ---------------------------------------------------
30010 print"[147]inhaltsverzeichnis:[146]"
30110 print#15,"io":open2,8,2,"#"
30120 t=18:s=1
30130 print#15,"u1";2;0;t;s
30140 print#15,"b-p";2;0
30150 get#2,x$:ifx$=""thenx$=chr$(0)
30160 t=asc(x$)
30170 get#2,x$:ifx$=""thenx$=chr$(0)
30180 s=asc(x$)
30190 forx=0to7
30192 print#15,"b-p";2;x*32+2
30194 get#2,x$:ifx$=""thenx$=chr$(0)
30196 ifasc(x$)=0then30290
30200 print#15,"b-p";2;x*32+5
30210 ff$=""
30220 fory=0to15
30230 get#2,x$:ifx$=""thenx$=chr$(0)
30240 ifasc(x$)=160then30270
30250 ff$=ff$+x$
30260 nexty
30270 ifa=0thena=1:printff$;:goto30290
30280 a=0:printtab(19);"[167] ";ff$
30290 nextx
30300 ift<>0then30130
30310 close2:print
30330 goto50
50000 rem texteingabe ----------------------------------------------------------
50002 ifar=1thenar=0:a$="satznummer zu hoch![146]":goto50007
50006 gosub9000:gosub9100
50007 print" ";:print"satz";sa;"[146]"
50008 print" [145]";a$
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]";
50010 print""
50020 be$="":poke198,0:poke211,0:poke214,22:sys58732:print"[158][164]";
50030 getx$:ifpeek(203)=1then50120
50035 if peek(203)=7andpeek(653)=0 then sc=1 : gosub 20000 : goto 50000
50037 if peek(203)=7andpeek(653)=1 then sc=-1 : gosub 20000 : goto 50000
50040 ifx$=""then50030
50050 iflen(be$)=0andasc(x$)=20then50030
50060 i=asc(x$):ifi<32ori>133andi<159thenifi<>20then50030
50070 iflen(be$)=slandi<>20then50030
50075 ifx$=" "thenx$=""
50080 be$=be$+x$
50090 printchr$(20);x$;"[164]";
50100 ifi=20thenbe$=left$(be$,len(be$)-2):goto50030
50110 goto50030
50120 print"[157] ":gosub9000
50130 ifbe$=""thenbe$=":"
50140 print"":return
60000 rem markieren wie datiert wird -------------------------------------------
60010 i$=a$:fori=1tolen(i$):m$(i)="0":next
60020 im=1:print
60025 printi$:fori=1tolen(i$):printm$(i);:next:print
60030 print"edit >";mid$(i$,im,1);"< "im"[146]"
60035 i=peek(203):ifi=64then60035
60040 ifi=2andpeek(653)=0andim<>len(i$)thenim=im+1:goto60070
60042 ifi=2andpeek(653)=1andim<>1thenim=im-1:goto60070
60045 ifi=56thenm$(im)="1":goto60070
60055 ifi=35thenm$(im)="0":goto60070
60056 ifi=1then60100
60060 goto60035
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
60100 rem umrechnen
60102 fori=1to3:ma(i)=0:mb(i)=0:nexti
60105 forii=1to3
60110 :fori=1tolen(i$):ifma(ii)=0andm$(i)=right$(str$(ii),1)thenma(ii)=i
60113 nexti
60115 :ifma(ii)=0then60150
60120 : mb(ii)=ma(ii)
60125 : mb(ii)=mb(ii)+1:remprint,mb(ii)
60130 : ifm$(mb(ii))<>right$(str$(ii),1)thenmb(ii)=mb(ii)-1:goto60150
60135 : ifmb(ii)=len(i$)then60150
60140 : goto60125
60150 nextii
60170 print"die sortierung erfolgt nach folgendem stringbereich:"
60180 print""mid$(i$,ma(1),mb(1)-ma(1)+1)"[146]"
60190 return
61000 rem floppy-fehlerkanal lesen ---------------------------------------------
61005 print"[147]floppy-fehlerkanalabfrage[146]"
61010 input#15,a,b$,c,d
61020 printa,b$,c,d
61040 goto50