home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 25
/
025.d81
/
f.cmd
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
9KB
|
213 lines
0 rem******** file cabinet ***********
1 rem******** djb shibley ***********(NULL)
10 gosub1000:gosub800:goto100
14 x=len(y$):printy$left$(l$,x);
15 forj=1to50:getx$:ifx$=""thennext:goto18
16 j=50:next:return
18 printleft$(sp$,x)left$(l$,x);
19 forj=1to40:getx$:ifx$=""thennext:goto14
21 j=40:next:return
25 y$="[209]":z$=""
27 gosub14:ifx$=""orx$=chr$(13)thenprint" ":return
29 ifx$="[157]"orx$=chr$(20)andlen(z$)=.then27
31 ifx$="[157]"orx$=chr$(20)thenz$=left$(z$,len(z$)-1):print"[157] [157][157]";:goto27
33 ifx$>"^"orlen(z$)=dlthen27
35 ifx$<" "orx$=chr$(34)orx$=","orx$=":"orx$=";"then27
39 print"[158]"x$"";:z$=z$+x$:goto27
100 poke53280,2:poke53281,2:print"[147]"spc(13)"return command[150]"
105 printce$;:dl=39:gosub25:printce$:ifz$="h"orz$="help"thenrun
120 print"[147]":ifx$=""orz$="end"orz$="quit"orz$="q"then1100
125 ifz$="m"orleft$(z$,4)="main"then1125
135 ifz$="d"orz$="display"orz$="l"orz$="list"then360
140 ifz$="set print"orz$="set p"orz$="set"then400
150 ifz$="initialize old"orz$="i old"orz$="i"orz$="initialize"then175
154 ifz$<>"initialize new"andz$<>"i new"then200
155 open3,8,3,"0:qaz[218][193][209],s,w":print#3,"1":close3:open15,8,15
156 print#15,"s0:qaz[218][193][209]":close15
158 open15,8,15:input#15,w$,x$,y$,z$:close15:ifw$<>"00"then170
160 print"[144]***warning[144]***[150]":print"drive formatted data will be lost"
162 print"shall i continue with new format ? y/n"
165 getx$:ifx$<>"y"andx$<>"n"then165
167 print"[147]":ifx$="n"then100
170 open15,8,15:print#15,"n0:file data,01":close15
175 open2,8,2,"0:dir,s,r":input#2,t1:close2:ifst<>.then185
177 print"this disk contains"t1"files"
178 print"[144]***warning[144]***[150]":print"all files will be erased"
180 print"shall i continue formatting ? y/n"
182 getx$:ifx$<>"n"andx$<>"y"then182
184 print"[147]":ifx$="n"then100
185 open15,8,15:print#15,"s0:dir":print#15,"s0:qwertyuiopasdfgh"
186 print#15,"s0:ptr.fmt":close15:open3,8,3,"0:ptr.fmt,s,w":print#3,"01":close3
188 open3,8,3,"0:dir,s,w":print#3,"1":print#3,"qwertyuiopasdfgh1qwertyuiop"
190 close3:open3,8,3,"0:qwertyuiopasdfgh,s,w":print#3,"1":print#3,"psudo."
195 close3:goto100
200 c$="":f$="":s1=.:s2=len(z$)+1:forj=1tos2-1
205 ifs1>.thenifmid$(z$,j,1)="="thens2=j
206 ifs1=.thenifmid$(z$,j,1)=" "thens1=j
210 next:ifs1=.thengosub900:goto100
215 c$=left$(z$,s1-1):f$=mid$(z$,s1+1,s2-s1-1):iff$=""thengosub906:goto100
216 iflen(f$)<16thenf$=f$+left$(sp$,16-len(f$))
220 f=.:gosub940:ift1=.then100
225 forj=1tot1:iff$=left$(w$(j,.),16)thenf=j
228 next:iff=.thenprint"[144]***"f$" not on disk[144]***[150]":gosub910:goto100
230 ff$=mid$(w$(f,.),18):ifc$<>"r"andc$<>"rename"then260
235 ifs2=>len(z$)thengosub906:goto100
237 i$=mid$(z$,s2+1):iflen(i$)<16theni$=i$+left$(sp$,16-len(i$))
240 x=.:forj=1tot1:ifleft$(w$(j,.),16)=i$thenx=j
244 next:ifx>.thenprint"[144]***file dup. error[144]***[150]":gosub910:goto100
250 w$(f,.)=i$+mid$(w$(f,.),17):open15,8,15:print#15,"r0:"+i$+"="+f$:close15
252 gosub950:goto100
260 ifc$<>"k"andc$<>"kill"then275
265 forj=ftot1:w$(j,.)=w$(j+1,.):next:t1=t1-1
266 open15,8,15:print#15,"s0:"+f$:close15:ift1>.thengosub950:goto100
269 open15,8,15:print#15,"s0:dir"::close15:goto100
275 ifc$<>"c"andc$<>"copy"then290
280 gosub960:print"change disks and touch a key[150]":gosub910:print"[147]":gosub975
284 t1=.:open2,8,2,"0:dir,s,r":input#2,t1:ifst<>.thenclose2:goto288
285 forj=1tot1:input#2,w$(j,.):next:close2
286 x=1:xx=.:forj=1tot1:ifleft$(w$(j,.),16)=f$thenx=x+1:xx=xx+1
287 w$(j,.)=w$(x,.):x=x+1:next:t1=t1-xx
288 t1=t1+1:w$(t1,.)=f$+right$(str$(f1),1)+ff$:gosub950:goto100
290 ifc$="s"orc$="sort"then300
295 gosub900:goto100
300 print:f1=val(mid$(w$(f,.),17,1)):f2$(1)=mid$(w$(f,.),18,10)
301 iff1=1thenx$="1":goto318
305 forj=1tof1:f2$(j)=mid$(w$(f,.),8+10*j,10):printj" "f2$(j):next
310 print"press # of field to sort by"
315 getx$:ifx$<"1"orval(x$)>f1andx$<>""then315
316 ifx$=""then100
318 gosub960:s=val(x$):dimm$(t+1,11):print"[147][150]"spc(15)"sorting"
320 forh=1tot:x$="\":x=.:fori=1tot:ifw$(i,s)<x$thenx$=w$(i,s):x=i
330 next:ifasc(f2$(1))=42thenforj=1to11:m$(h,j)=w$(x,j):w$(x,j)="":next:goto340
335 forj=1tof1:m$(h,j)=w$(x,j):w$(x,j)="":next
340 w$(x,s)="\\":printx$:next:fori=1tot:forj=1tof1:w$(i,j)=m$(i,j):m$(i,j)=""
345 next:ifasc(f2$(1))=42thenforj=2to11:w$(i,j)=m$(i,j):m$(i,j)="":next
350 next:gosub975:run
360 gosub940:ift1=.then100
362 ifz$="d"orz$="display"then385
370 open4,4:print#4,spc(30)"file cabinet listing"chr$(13)chr$(13)
375 fori=1tot1:print#4,left$(w$(i,.),16)" ";:forj=1toval(mid$(w$(i,.),17,1))
380 print#4,mid$(w$(i,.),8+10*j,10)" ";:next:print#4,chr$(13):next
382 forj=.to9:print#4:next:close4:goto100
385 print"[147] files on this disk are:[152]"
388 fori=1tot1:printleft$(w$(i,.),16)" ";:ifint(i/2)=i/2thenprint
390 next:gosub910:goto100
400 poke53280,4:poke53281,15:print"[147]1 heading is - "
404 print"2 comma is -":print"3 - return to command mode":pr$="01"
406 open2,8,2,"0:ptr.fmt,s,r":input#2,x$:ifst=64thenpr$=x$
408 close2:p(.)=val(left$(pr$,1)):p(1)=val(right$(pr$,1))
410 print"[144]"spc(20)p0$(p(.))"":printspc(20)p1$(p(1))
415 getx$:if(x$<"1"orx$>"3")andx$<>""then415
417 ifx$="1"thenp(.)=p(.)+1:ifp(.)=3thenp(.)=.
418 ifx$="2"thenp(1)=p(1)+1:ifp(1)=2thenp(1)=.
419 ifx$="1"orx$="2"then410
422 print"[147]":open15,8,15:print#15,"s0:ptr.fmt":close15:open3,8,3,"0:ptr.fmt,s,w"
424 print#3,right$(str$(p(.)),1)+right$(str$(p(1)),1):close3:goto100
780 print"[147] main program[157][157][157][157][157][157][157][157][157][157][157][157][197][197][197][197][197][197][197][197][197][197][197][197][158]"
782 print" this command will get you out of"
784 print"command mode and return you to file"
786 print"cabinet's main menu. may be abbre-"
787 print"viated - m":printspc(17)"quit[157][157][157][157][197][197][197][197][158]"
788 print" this command is used to terminate"
789 print"the program. can be shortened to - q"
791 print"(run/stop key or end will also work)":gosub910:return
800 poke53280,.:poke53281,.:print"[147][158] the following is a list of commands"
802 print"and options (and explanations) that"
804 print"are available to you."
806 print" if you wish not to view the entire"
808 print"list at any time, depress the run/stop"
810 print"key.":gosub910:ifx$=""thenreturn
815 print"[147] help[157][157][157][157][197][197][197][197][158]"
817 print" returning the word "chr$(34)"help"chr$(34)" will cause aredispla";
820 print"y of this entire list. help "
822 print"may be abbreviated with - h":gosub910:ifx$=""thenreturn
825 print"[147] initialize new[157][157][157][157][157][157][157][157][157][157][157][157][157][157][197][197][197][197][197][197][197][197][197][197][197][197][197][197][158]"
826 print" the "chr$(34)"initialize new"chr$(34)" command will"
828 print"first format your blank disk currently"
830 print"in the drive, then it will set up the"
832 print"proper data files for file cabinet to"
833 print"use. use this command only when an un-"
835 print"formatted disk is in the disk drive."
836 print"may be abbreviated - i new":gosub910:ifx$=""thenreturn
839 print"[147] initialize old[157][157][157][157][157][157][157][157][157][157][157][157][157][157][197][197][197][197][197][197][197][197][197][197][197][197][197][197][158]"
840 print" this command will set up the proper"
842 print"data files for use in file cabinet."
843 print" it does not format the entire disk,"
845 print"therefore it is safe to use with a non-"
846 print"blank disk. however, any files saved"
847 print"through file cabinet will be erased."
848 print"may be abbreviated - initialize,"
849 print"i old, or i":gosub910:ifx$=""thenreturn
850 print"[147] display[157][157][157][157][157][157][157][197][197][197][197][197][197][197][158]"
852 print" the "chr$(34)"display"chr$(34)" command will tell you"
853 print"the names of all the data files saved"
855 print"by file cabinet on the floppy diskette"
856 print"currently in your drive. the display"
857 print"abbreviation is - d":gosub910:ifx$=""thenreturn
859 print"[147]