home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1985 December
/
1985-12.d64
/
dmanager
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
85 lines
10 poke55,0:poke56,25:clr:sa=peek(56)*256:print"[147]"
20 ln=5:d$="":s$=" "
30 print chr$(142)tab(8)d$" dictionary manager "
40 print " press: [1] to review entries":print s$"[2] to add entries"
50 print s$"[3] to edit entries":print s$"[4] to print entries"
60 print s$"[5] to prepare a new disk":print s$"[6] to exit the manager"d$
70 get k$:if k$<"1" or k$>"6" then 70
80 on val(k$) gosub 400,500,700,600,100,90:goto 30
90 print"[147]":end
100 print s$" create new dictionary disk ":print"are you sure";
110 input" [y/n]";k$:if left$(k$,1)<>"y" then print"[147]":return
120 input"unique id for this disk";id$:print"formatting....please wait"
130 open 15,8,15,"n0:dictionary disk,"+id$:gosub1000:if er then return
140 print"formatting complete...creating headings:"
150 for i=65 to 90:open 1,8,8,"0:"+chr$(i)+",s,w":gosub 1000:if er then 180
160 close 1:print chr$(i);:next:print
170 print"** dictionary disk created **":goto 910
180 print"creating file for ";chr$(i):print"try again";:goto 110
200 print s$"(enter @[146] for menu)"
210 input"starting with";l$:l=asc(l$+chr$(0)):if l=64 or l=42 then return
220 l$=chr$(l):if l<65 or l>90 then print s$l$" is not a valid letter":goto 210
230 open15,8,15:open1,8,8,"0:"+l$+k$:gosub 1000:if er=0 then return
240 print"trying to access file for ";l$:goto 210
300 f=0:get#1,k$:k=asc(k$+chr$(0)):if k>127 then k=k and 127:f=1
310 if k<>39 then k=k or 64
320 w$=w$+chr$(k):if st or f then return
330 goto 300
400 print s$" review entries ":k$=",s,r":gosub 200:if l=64 or l=42 then return
410 get#1,k$:w$=l$:gosub 300:if mid$(w$,2,1)<>"@" then 430
420 print"** no entries for ";l$;" **":goto 910
430 print chr$(14)"[147][197]ntries for "l$:print"([200]old down space [146] to advance)"
440 print s$;w$:if st then 460
450 wait 203,64,64:w$=l$:gosub 300:goto 440
460 if st<>64 then 1000
470 wait 203,64:poke 198,0:goto 910
500 print s$" add entries ":k$=",a":gosub 200:if l=64 or l=42 then return
510 print chr$(14)"[147][197]nter words starting with ";l$:print"([212]ype @[146] to quit)"
520 w$="":input w$:f$=left$(w$,1):if f$="@"then close1:close15:print"[147]":return
530 if f$<>l$ and f$<>chr$(l+128)thenprintw$" doesn't start with "l$"":goto520
540 n=len(w$):if n<ln then print w$" has fewer than"ln"letters":goto 520
550 for i=2 to n:k=asc(mid$(w$,i)):if k=39 then 570
560 if k<65 or(k>90 and k<193)or k>218 then k=0
570 k=k and 63:if i=n then k=k or 128
580 if k then print#1,chr$(k);:if st then 1000
590 next:print s$w$" added.":goto 520
600 print s$" print entries ":print" (enter *[146] to print all entries)"
610 k$=",s,r":gosub 200:if l=64 then return
620 open 4,4,7:if l=42 then for i=65 to 90:l$=chr$(i):k$=",s,r":gosub 230
630 get#1,k$:w$=l$:gosub 300:k=st:if mid$(w$,2,1)<>"@" then 640
635 print#4,"** no entries for "l$" **":goto 680
640 print#4,chr$(14)"[197]ntries beginning with "l$":":print#4
650 forj=1to4:print#4,w$;:ifj<4thenprint#4,right$(" ",20-len(w$))";
655 [139] k [167] j[178]4:[137] 670
660 w$[178]l$:[141] 300:k[178]st
670 [130] j:[152]4:[139] k[178]0 [167] 650
675 [139] k[179][177]64 [167] [160] 4:[137] 1000
680 [160] 1:[160] 15:[152]4:[152]4:[139] l[178]42 [167] [130] i
690 [160] 4:[142]
700 [153] s$" edit entries ":k$[178]",s,r":[141] 200:[139] l[178]64 [176] l[178]42 [167] [142]
710 [153] [199](14)"loadvaldit words starting with "l$":"
720 [153]"(valnter @wait to cancel editing)":[161]#1,k$:ad[178]sa
730 w$[178]l$:[141] 300:[139] [202](w$,2,1)[178]"@" [167] [153]"** (NULL)o entries **":[137] 910
740 [153]" "w$:k$[178]"":[133]"on";k$:n[178][195](k$):[139] n[178]0 [167] 830
750 f$[178][200](k$,1):[139] f$[178]"@" [167] [153]"valditing canceled":[137] 910
760 [139] f$[179][177]l$ [175] f$[179][177][199](l[170]128)[167] [153] k$" doesn't start with "l$:[137] 740
770 [139] n[179]ln [167] [153] k$"has fewer than"ln"letters":[137] 740
780 [129] i[178]2 [164] n:k[178][198]([202](k$,i)):[139] k[178]39 [167] 810
790 [139](k[177]64 [175] k[179]91)[176](k[177]192 [175] k[179]219) [167] 810
800 [153] k$" has invalid character":ad[178]ad[171]i[171]2:[137] 740
810 k[178]k [175] 63:[139] i[178]n [167] k[178]k [176] 128
820 [151] ad,k:ad[178]ad[170]1:[130]:[139] ad[177]40959 [167] ad[178]ad[171]n:[153]"buffer full":[137]850
830 [139] st[178]0 [167] 730
840 [139] st[179][177]64 [167] 1000
850 [153]"** (NULL)riting new file for "l$" **"
860 [160] 1:[152]15,"s0:"[170]l$:[141] 1000:[139] er[179]2 [167] 890
870 [133]"try again [y/n]";k$:[139] [200](k$,1)[179][177]"y" [167] [142]
880 [159] 15,8,15:[137] 850
890 [159] 1,8,8,"0:"[170]l$[170]",s,w":[152]1:[139] st [167] [141] 1000:[137] 870
900 [129] i[178]sa [164] ad[171]1:[152]1,[199]([194](i));:[130]:[139] st [167] [141] 1000:[137] 870
910 [160] 1:[160] 15:[153]" press any key for menu "
920 [161] k$:[139] k$[178]"" [167] 920
930 [153]"load":[142]
1000 [132]15,er,e$:[139] er[177]1 [167] [153]" disk error:";er;e$:[160] 15:[160] 1
1010 [142]