home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er Special 16
/
64er_Magazin_Sonderheft_16_19xx_Markt__Technik_de_Side_A.d64
/
demo-karteiverw
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
8KB
|
362 lines
100 rem *******************************
110 rem * *
120 rem * ak-soft proudly presents : *
130 rem * *
140 rem * > karteikarten-verwaltung < *
150 rem * *
160 rem * programmed with *
170 rem * *
180 rem * t w m v1.0 *
190 rem * *
200 rem * by a.knuepfer *
210 rem * auf dem knuell 18 *
220 rem * 2056 glinde *
230 rem * tel. 040/710 80 06 *
240 rem * *
250 rem *******************************
260 :
296 :
297 rem -------------------------------
298 rem initialisierung
299 :
300 if peek(32168)<>162 or peek(38168)<>150 then load "twm v1.0",8,1
310 sys 32168
320 :
330 (NULL) 0
350 poke 53280,0 :poke 53281,0 :poke 650,128
360 poke 40909,34 :rem finput# erkennt (auch) anfuehrungszeichen als stringende
370 print chr$(14)
396 :
397 rem -------------------------------
398 rem titel
399 :
400 if peek(828)<>0 then 600
402 poke 828,1
405 (NULL)
410 (NULL) 4,0,"[193][203]-[211][207][198][212]"
420 (NULL) 6,"proudly presents"
430 (NULL) 8,"> [203][193][210][212][197][201][203][193][210][212][197][206] - [214][197][210][215][193][204][212][213][206][199] <"
440 (NULL) 11,"programmed with"
450 (NULL) 13,"[212] [215] [205] - [212][200][197] [215][201][206][196][207][215] [205][193][206][193][199][197][210] [214]1.0"
460 (NULL) 16,"by"
470 (NULL) 18,"[193].[203]nuepfer, [199]linde 1986"
480 :
500 f(0)=0 :f(1)=11 :f(2)=12 :f(3)=15 :f(4)=1 :rem graustufen
510 for z=0 to 24 :for f=0 to 4 :(NULL) f(f),z,0,z,39 :for h=1 to 30 :next h,f,z
520 for h=1 to 2000 :next
530 for f=4 to 0 step -1 :(NULL) f(f),4,4,18,34
540 for h=1 to 30 :next h,f
550 for h=1 to 1000 :next
596 :
597 rem -------------------------------
598 rem hauptprogramm anspringen
599 :
600 goto 10000
992 :
993 :
994 rem ===============================
995 rem kleinere unterprogramme
996 :
997 rem -------------------------------
998 rem boxmenu anlegen
999 :
1000 (NULL) :z=0 :s=0
1010 for b=0 to bn
1020 (NULL) z,s,b(b),b$(b);
1030 s1=s+len(b$(b))-1
1040 (NULL) b(b),z,s,z,s1
1050 (NULL)b,z,s,z,s1,b(b)+128
1060 s=s1+1+t
1070 next b
1080 return
1096 :
1097 rem ------------------------------
1098 rem datendiskette
1099 :
1100 (NULL)4,12,2,18,37,1 :(NULL)4,5,128 :(NULL)4
1110 (NULL) 1,5,"[194]itte [155] [196][193][212][197][206] - [196][201][211][203][197][212][212][197] "
1120 (NULL) 3,5,"ins [204]aufwerk einlegen !"
1130 return
1194 :
1195 rem ------------------------------
1196 rem nicht ok / ok ?
1197 rem ja -> ok=1
1198 rem nein -> ok=0
1199 :
1200 ok=1
1210 (NULL)100,20,19,24,39,1 :(NULL)100,14,128 :(NULL)100
1220 (NULL) 1,2,"[206][201][195][200][212] [207][203]"
1230 (NULL) 1,14,"[207][203]"
1240 (NULL)
1250 (NULL)0,1,1,1,10,1
1260 (NULL)1,1,12,1,17,1
1270 (NULL) "help boxmenu" :(NULL) ok
1280 (NULL) :(NULL)100
1290 return
1296 :
1297 rem ------------------------------
1298 rem diskstatus-test
1299 :
1300 input#15,f1,ff$,ft,fs :if f1<2 then return
1310 printchr$(7);
1320 (NULL)100,8,2,16,37,1,0,"[196][201][211][203][197][212][212][197][206][198][197][200][204][197][210]" :(NULL)100,7,0 :(NULL)100
1330 f1$=usr("##")f1 :ft$=usr(ft) :fs$=usr(fs)
1340 (NULL) 1,1," "+f1$+","+ff$+","+ft$+","+fs$+" "
1350 (NULL) 3,7,"... mit [210][197][212][213][210][206] [146] quittieren !"
1360 get w$ :if w$<>chr$(13) then 1360
1370 (NULL) :(NULL)100
1380 return
1396 :
1397 rem ------------------------------
1398 rem window fuer datensatznr.
1399 :
1400 (NULL)7,10,7,16,33,1,0,he$ :(NULL)7,4,128 :(NULL)7
1410 return
1496 :
1497 rem ------------------------------
1498 rem kartei-datensatz in maske
1499 :
1500 nr=peek(30964) :if nr<>0 then (NULL)0
1510 (NULL) 4,28,15,"[206]r."usr("###")i1;"[152]"usr("/###")n1;
1520 (NULL)10
1525 if i1=0 then (NULL) :goto 1540
1530 for i2=1 to n2 :(NULL)#(i2-1),a$(i1,i2) :next
1540 if nr<>10 then (NULL)nr
1550 return
1992 :
1993 :
1994 rem ==============================
1995 rem groessere unterprogramme
1996 :
1997 rem ------------------------------
1998 rem arbeitsbildschirm aufbauen
1999 :
2000 (NULL)
2010 (NULL) 0,1,15,"[203][193][210][212][197][201][203][193][210][212][197][206]-[214][197][210][215][193][204][212][213][206][199]"
2015 (NULL) 24,15," f5 [146] [200]ilfstexte f6 [146] [200]ardcopy"
2020 :
2030 rem ----- haupt-boxmenu
2040 rem bereich festlegen, in dem sich der cursor bewegen darf:
2050 (NULL)1,2,1,2,25,0 :(NULL)1,15,0 :(NULL)1
2060 b$(0)=" [197][206][196][197] " :b(0)=7 :rem text/farbe
2070 b$(1)=" [204][207][193][196] " :b(1)=10
2080 b$(2)=" [197][196][201][212] " :b(2)=5
2090 b$(3)=" [211][193][214][197] " :b(3)=14
2100 t=0 :bn=3 :gosub 1000
2110 :
2120 rem ----- edit-boxmenu
2130 (NULL)2,22,1,22,39,0 :(NULL)2,15,0 :(NULL)2
2140 b$(0)="_" :b(0)=7
2150 b$(1)="[193][197][206][196][197][210][206]" :b(1)=10
2160 b$(2)="[204][207][197][211][195][200]" :b(2)=10
2170 b$(3)="<<" :b(3)=15
2180 b$(4)="<" :b(4)=15
2190 b$(5)=">" :b(5)=15
2200 b$(6)=">>" :b(6)=15
2210 b$(7)="[193][206][198][213][197][199]" :b(7)=10
2220 b$(8)="[211][207][210][212]" :b(8)=5
2230 t=1 :bn=8 :gosub 1000
2240 :
2250 rem ----- zeit-anzeige
2260 (NULL)3,0,30,2,39,1 :(NULL)3,12,128 :(NULL)3
2270 (NULL) "000000",1,31
2280 :
2290 rem ----- karteikarten-window
2300 (NULL)10,6,0,20,39,1 :(NULL)10,6,128 :(NULL)10
2310 :
2320 return
2396 :
2397 rem ------------------------------
2398 rem allgemeines
2399 :
2400 open 15,8,15
2420 :
2430 rem ----- uhrzeit eingeben
2440 :
2450 (NULL)5,4,12,8,37,1 :(NULL)5,4,128 :(NULL)5
2455 (NULL) "help winput"
2460 (NULL) 1,1,4,"[218][197][201][212] ([200][200][205][205][211][211]) : ",n,6,15,tm$
2470 if len(tm$)<>6 then printchr$(7) :goto 2460
2480 (NULL) tm$
2490 (NULL) :(NULL)5
2500 return
2992 :
2993 :
2994 rem ==============================
2995 rem hauptmenu-funktionen
2996 :
2997 rem ------------------------------
2998 rem load
2999 :
3000 gosub 1100 :rem datendisk einlegen
3010 gosub 1200 :rem alles klar ?
3020 if ok=0 then (NULL) :(NULL)4 :return
3030 jn$="j"
3040 print "[147]"
3045 (NULL) "help winput"
3050 (NULL) 1,2,5,"[197]xistiert die [196]atei schon ? ",,"jn",1,15,jn$
3060 if jn$="n" then 3500
3070 :
3080 rem ----- existierende datei laden
3085 clr :hm=1 :open15,8,15 :dim d$(100)
3090 print"[147]" :(NULL) 1,"[197]inlesen des"
3100 (NULL) 3,"[196]isketten-[201]nhaltsverzeichnisses"
3110 :
3115 d=1
3120 open 1,8,0,"$" :gosub 1300 :if f1>1 then close1 :(NULL) :(NULL)4 :return
3130 n=0 :get#1,x$,x$
3140 get#1,x$,x$,x$,x$ :(NULL)1,x$
3150 if left$(x$,6)="blocks" then close1 :n=n-1 :goto 3190
3160 (NULL)1,x$ :d$(n)=x$ :(NULL)1,x$
3165 if d=1 and d$(n)="test" then d=n
3170 n=n+1 :goto 3140
3180 :
3190 if n>0 then 3210
3195 print"[147]"
3200 (NULL) 2,15," *** [198]alsche [196]iskette *** " :(NULL) "_",128+5 :goto 3040
3210 (NULL)6,4,18,22,37,1,0,"[203]arteiname" :(NULL)6,2,128 :(NULL)6
3220 (NULL) "help menu" :(NULL) d$(1),d$(n),0,1,10,1,d
3225 if d=0 then (NULL) :(NULL)6 :goto 3040
3230 :
3240 he$="[204]aden" :gosub 1400
3250 (NULL) 1,"[197]ingabemaske"
3260 dn$=d$(d)
3270 (NULL) dn$+chr$(160)+"m" :gosub 1300 :if f1>1 then 3360
3280 (NULL)
3290 open 1,8,2,dn$+chr$(160)+"d,s,r" :gosub 1300 :if f1>1 then 3360
3300 (NULL)1,x1$,x2$ :n1=val(x1$) :n2=val(x2$)
3310 dim a$(200,n2) :if n1=0 then i1=0 :goto 3355
3320 for i1=1 to n1 :i$=usr("###")i1 :(NULL) 1,"[206]r."+i$
3330 for i2=1 to n2
3340 (NULL)1,x$ :a$(i1,i2)=x$
3350 next i2,i1
3352 i1=1
3355 ff=1
3360 close1
3370 (NULL) :(NULL)7 :(NULL) :(NULL)6
3380 (NULL)10 :(NULL)4
3390 if n1>0 then gosub 1500
3400 goto 10330
3499 :
3500 rem ----- neue datei anlegen
3505 clr :hm=1 :open15,8,15
3510 dn$="test" :(NULL) 3,2,5,"[206]ame der [196]atei : ",a,14,15,dn$
3520 (NULL) :(NULL)4
3550 print"[147]"
3560 (NULL) "help maskdef 1" :(NULL)
3570 gosub 1200 :if ok=0 then 3560
3580 (NULL)
3590 (NULL)
3600 n2=(NULL)(0) :poke 829,n2
3610 (NULL) "@:"+dn$+chr$(160)+"m"
3620 open 1,8,2,"@:"+dn$+chr$(160)+"d,s,w" :gosub 1300
3625 if f1>1 then close 1 :goto 3670
3630 print#1,0 :print#1,n2
3640 close 1
3650 ff=1 :i1=1
3660 dim a$(200,n2)
3680 goto 10330
3996 :
3997 rem ------------------------------
3998 rem edit
3999 :
4000 bb=5 :if n1=0 then bb=7
4020 (NULL)2 :(NULL) "help editmenu" :(NULL) bb :(NULL)10
4030 if bb=0 then return
4040 if n1=0 and bb<>7 then printchr$(7); :goto 4020
4050 on bb gosub 4220,4100,4310,4300,4400,4410,4200,4500
4060 gosub 1500 :goto 4020
4098 :
4099 rem ----- loeschen
4100 gosub 1200 :if ok=0 then return
4110 n1=n1-1
4120 for i=i1 to n :for i2=1 to n2 :a$(i,i2)=a$(i+1,i2) :next i2,i
4130 if i1>n1 then i1=n1
4140 return
4198 :
4199 rem ----- anfuegen
4200 n1=n1+1 :i1=n1
4210 (NULL)
4220 (NULL) "help medit" :(NULL)
4230 for i2=1 to n2 :(NULL)#(i2-1),a$(i1,i2) :next
4240 return
4298 :
4299 rem ----- "<", "<<"
4300 i1=i1-1 :goto 4320
4310 i1=i1-5
4320 if i1<1 then i1=1 :printchr$(7);
4330 return
4398 :
4399 rem ----- ">", ">>"
4400 i1=i1+1 :goto 4420
4410 i1=i1+5
4420 if i1>n1 then i1=n1 :printchr$(7);
4430 return
4498 :
4499 rem ----- alphabetisch sortieren
4500 he$="[211]ortieren" :gosub 1400
4510 m=n1
4520 m=int(m/2) :m$=usr("###")m :(NULL) 1,"[206]r."+m$ :if m=0 then 4650
4530 k=n1-m :j=1
4540 i=j
4550 for i2=1 to n2
4560 if a$(i,i2)<a$(i+m,i2) then i2=n2 :next :goto 4630
4570 if a$(i,i2)>a$(i+m,i2) then i2=n2 :next :goto 4600
4580 next i2
4590 goto 4630
4600 for i2=1 to n2 :t$=a$(i,i2) :a$(i,i2)=a$(i+m,i2) :a$(i+m,i2)=t$ :next i2
4610 i=i-1
4620 if i>=1 then 4550
4630 j=j+1 :if j>k then 4520
4640 goto 4540
4650 (NULL) :(NULL)7
4660 i1=1
4670 return
4996 :
4997 rem ------------------------------
4998 rem save
4999 :
5000 gosub 1200 :if ok=0 then return
5010 he$="[211]peichern" :gosub 1400
5020 open 1,8,2,"@:"+dn$+chr$(160)+"d,s,w"
5030 gosub 1300 :if f1>2 then 5070
5040 print#1,n1 :print#1,n2
5045 if n1=0 then 5070
5050 for i=1 to n1 :i$=usr("###")i :(NULL) 1,"[206]r."+i$
5060 for i2=1 to n2 :print#1,a$(i,i2) :next i2,i
5070 close1
5080 (NULL) :(NULL)7
5090 return
9996 :
9997 rem ==============================
9998 rem h a u p t p r o g r a m m
9999 :
10000 gosub 2000 :rem arbeitsbildschirm aufbauen
10010 gosub 2400 :rem allgemeines
10020 :
10030 hm=1 :rem beim ersten mal 'load' waehlen
10096 :
10097 rem -----------------------------
10098 rem hauptmenu
10099 :
10100 (NULL)1
10110 (NULL) "help hauptmenu" :(NULL) hm
10120 if hm > 0 then 10200
10130 :
10140 rem ----- ende
10150 ok=0 :gosub 1210 :if ok=0 then 10110
10160 print"[147][212]schuess !"
10170 end
10198 :
10199 rem ----- load-abfrage, beim ersten mal m u s s 'load' gewaehlt werden !
10200 if ff=0 and hm<>1 then hm=1 :printchr$(7); :goto 10110
10299 :
10300 rem ----- funktionen anspringen
10310 (NULL)10
10320 on hm gosub 3000,4000,5000
10330 (NULL)0
10340 if ff=0 then 10100
10350 if hm=1 then (NULL) 4 :(NULL) 4,1,12,"[203]artei [155]'";dn$;"'"
10360 gosub 1500
10370 goto 10100