home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 25 / 025.d81 / f.cmd (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  9KB  |  213 lines

  1. 0 rem********  file cabinet  ***********
  2. 1 rem********  djb  shibley  ***********(NULL)
  3. 10 gosub1000:gosub800:goto100
  4. 14 x=len(y$):printy$left$(l$,x);
  5. 15 forj=1to50:getx$:ifx$=""thennext:goto18
  6. 16 j=50:next:return
  7. 18 printleft$(sp$,x)left$(l$,x);
  8. 19 forj=1to40:getx$:ifx$=""thennext:goto14
  9. 21 j=40:next:return
  10. 25 y$="[209]":z$=""
  11. 27 gosub14:ifx$=""orx$=chr$(13)thenprint" ":return
  12. 29 ifx$="[157]"orx$=chr$(20)andlen(z$)=.then27
  13. 31 ifx$="[157]"orx$=chr$(20)thenz$=left$(z$,len(z$)-1):print"[157]  [157][157]";:goto27
  14. 33 ifx$>"^"orlen(z$)=dlthen27
  15. 35 ifx$<" "orx$=chr$(34)orx$=","orx$=":"orx$=";"then27
  16. 39 print"[158]"x$"";:z$=z$+x$:goto27
  17. 100 poke53280,2:poke53281,2:print"[147]"spc(13)"return command[150]"
  18. 105 printce$;:dl=39:gosub25:printce$:ifz$="h"orz$="help"thenrun
  19. 120 print"[147]":ifx$=""orz$="end"orz$="quit"orz$="q"then1100
  20. 125 ifz$="m"orleft$(z$,4)="main"then1125
  21. 135 ifz$="d"orz$="display"orz$="l"orz$="list"then360
  22. 140 ifz$="set print"orz$="set p"orz$="set"then400
  23. 150 ifz$="initialize old"orz$="i old"orz$="i"orz$="initialize"then175
  24. 154 ifz$<>"initialize new"andz$<>"i new"then200
  25. 155 open3,8,3,"0:qaz[218][193][209],s,w":print#3,"1":close3:open15,8,15
  26. 156 print#15,"s0:qaz[218][193][209]":close15
  27. 158 open15,8,15:input#15,w$,x$,y$,z$:close15:ifw$<>"00"then170
  28. 160 print"[144]***warning[144]***[150]":print"drive formatted  data will be lost"
  29. 162 print"shall i continue with new format ?  y/n"
  30. 165 getx$:ifx$<>"y"andx$<>"n"then165
  31. 167 print"[147]":ifx$="n"then100
  32. 170 open15,8,15:print#15,"n0:file data,01":close15
  33. 175 open2,8,2,"0:dir,s,r":input#2,t1:close2:ifst<>.then185
  34. 177 print"this disk contains"t1"files"
  35. 178 print"[144]***warning[144]***[150]":print"all files will be erased"
  36. 180 print"shall i continue formatting ?  y/n"
  37. 182 getx$:ifx$<>"n"andx$<>"y"then182
  38. 184 print"[147]":ifx$="n"then100
  39. 185 open15,8,15:print#15,"s0:dir":print#15,"s0:qwertyuiopasdfgh"
  40. 186 print#15,"s0:ptr.fmt":close15:open3,8,3,"0:ptr.fmt,s,w":print#3,"01":close3
  41. 188 open3,8,3,"0:dir,s,w":print#3,"1":print#3,"qwertyuiopasdfgh1qwertyuiop"
  42. 190 close3:open3,8,3,"0:qwertyuiopasdfgh,s,w":print#3,"1":print#3,"psudo."
  43. 195 close3:goto100
  44. 200 c$="":f$="":s1=.:s2=len(z$)+1:forj=1tos2-1
  45. 205 ifs1>.thenifmid$(z$,j,1)="="thens2=j
  46. 206 ifs1=.thenifmid$(z$,j,1)=" "thens1=j
  47. 210 next:ifs1=.thengosub900:goto100
  48. 215 c$=left$(z$,s1-1):f$=mid$(z$,s1+1,s2-s1-1):iff$=""thengosub906:goto100
  49. 216 iflen(f$)<16thenf$=f$+left$(sp$,16-len(f$))
  50. 220 f=.:gosub940:ift1=.then100
  51. 225 forj=1tot1:iff$=left$(w$(j,.),16)thenf=j
  52. 228 next:iff=.thenprint"[144]***"f$" not on disk[144]***[150]":gosub910:goto100
  53. 230 ff$=mid$(w$(f,.),18):ifc$<>"r"andc$<>"rename"then260
  54. 235 ifs2=>len(z$)thengosub906:goto100
  55. 237 i$=mid$(z$,s2+1):iflen(i$)<16theni$=i$+left$(sp$,16-len(i$))
  56. 240 x=.:forj=1tot1:ifleft$(w$(j,.),16)=i$thenx=j
  57. 244 next:ifx>.thenprint"[144]***file dup. error[144]***[150]":gosub910:goto100
  58. 250 w$(f,.)=i$+mid$(w$(f,.),17):open15,8,15:print#15,"r0:"+i$+"="+f$:close15
  59. 252 gosub950:goto100
  60. 260 ifc$<>"k"andc$<>"kill"then275
  61. 265 forj=ftot1:w$(j,.)=w$(j+1,.):next:t1=t1-1
  62. 266 open15,8,15:print#15,"s0:"+f$:close15:ift1>.thengosub950:goto100
  63. 269 open15,8,15:print#15,"s0:dir"::close15:goto100
  64. 275 ifc$<>"c"andc$<>"copy"then290
  65. 280 gosub960:print"change disks  and touch a key[150]":gosub910:print"[147]":gosub975
  66. 284 t1=.:open2,8,2,"0:dir,s,r":input#2,t1:ifst<>.thenclose2:goto288
  67. 285 forj=1tot1:input#2,w$(j,.):next:close2
  68. 286 x=1:xx=.:forj=1tot1:ifleft$(w$(j,.),16)=f$thenx=x+1:xx=xx+1
  69. 287 w$(j,.)=w$(x,.):x=x+1:next:t1=t1-xx
  70. 288 t1=t1+1:w$(t1,.)=f$+right$(str$(f1),1)+ff$:gosub950:goto100
  71. 290 ifc$="s"orc$="sort"then300
  72. 295 gosub900:goto100
  73. 300 print:f1=val(mid$(w$(f,.),17,1)):f2$(1)=mid$(w$(f,.),18,10)
  74. 301 iff1=1thenx$="1":goto318
  75. 305 forj=1tof1:f2$(j)=mid$(w$(f,.),8+10*j,10):printj" "f2$(j):next
  76. 310 print"press # of field  to sort by"
  77. 315 getx$:ifx$<"1"orval(x$)>f1andx$<>""then315
  78. 316 ifx$=""then100
  79. 318 gosub960:s=val(x$):dimm$(t+1,11):print"[147][150]"spc(15)"sorting"
  80. 320 forh=1tot:x$="\":x=.:fori=1tot:ifw$(i,s)<x$thenx$=w$(i,s):x=i
  81. 330 next:ifasc(f2$(1))=42thenforj=1to11:m$(h,j)=w$(x,j):w$(x,j)="":next:goto340
  82. 335 forj=1tof1:m$(h,j)=w$(x,j):w$(x,j)="":next
  83. 340 w$(x,s)="\\":printx$:next:fori=1tot:forj=1tof1:w$(i,j)=m$(i,j):m$(i,j)=""
  84. 345 next:ifasc(f2$(1))=42thenforj=2to11:w$(i,j)=m$(i,j):m$(i,j)="":next
  85. 350 next:gosub975:run
  86. 360 gosub940:ift1=.then100
  87. 362 ifz$="d"orz$="display"then385
  88. 370 open4,4:print#4,spc(30)"file cabinet listing"chr$(13)chr$(13)
  89. 375 fori=1tot1:print#4,left$(w$(i,.),16)"   ";:forj=1toval(mid$(w$(i,.),17,1))
  90. 380 print#4,mid$(w$(i,.),8+10*j,10)"  ";:next:print#4,chr$(13):next
  91. 382 forj=.to9:print#4:next:close4:goto100
  92. 385 print"[147]       files  on this disk are:[152]"
  93. 388 fori=1tot1:printleft$(w$(i,.),16)"  ";:ifint(i/2)=i/2thenprint
  94. 390 next:gosub910:goto100
  95. 400 poke53280,4:poke53281,15:print"[147]1  heading is - "
  96. 404 print"2  comma   is -":print"3 - return to command mode":pr$="01"
  97. 406 open2,8,2,"0:ptr.fmt,s,r":input#2,x$:ifst=64thenpr$=x$
  98. 408 close2:p(.)=val(left$(pr$,1)):p(1)=val(right$(pr$,1))
  99. 410 print"[144]"spc(20)p0$(p(.))"":printspc(20)p1$(p(1))
  100. 415 getx$:if(x$<"1"orx$>"3")andx$<>""then415
  101. 417 ifx$="1"thenp(.)=p(.)+1:ifp(.)=3thenp(.)=.
  102. 418 ifx$="2"thenp(1)=p(1)+1:ifp(1)=2thenp(1)=.
  103. 419 ifx$="1"orx$="2"then410
  104. 422 print"[147]":open15,8,15:print#15,"s0:ptr.fmt":close15:open3,8,3,"0:ptr.fmt,s,w"
  105. 424 print#3,right$(str$(p(.)),1)+right$(str$(p(1)),1):close3:goto100
  106. 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]"
  107. 782 print"  this command will get you out of"
  108. 784 print"command mode and return you to file"
  109. 786 print"cabinet's main menu.    may be abbre-"
  110. 787 print"viated - m":printspc(17)"quit[157][157][157][157][197][197][197][197][158]"
  111. 788 print"  this command is used to terminate"
  112. 789 print"the program.  can be shortened to - q"
  113. 791 print"(run/stop key or  end  will also work)":gosub910:return
  114. 800 poke53280,.:poke53281,.:print"[147][158]  the following is a list of commands"
  115. 802 print"and options (and explanations) that"
  116. 804 print"are available to you."
  117. 806 print"  if you wish not to view the entire"
  118. 808 print"list at any time, depress the run/stop"
  119. 810 print"key.":gosub910:ifx$=""thenreturn
  120. 815 print"[147]                 help[157][157][157][157][197][197][197][197][158]"
  121. 817 print"  returning the word "chr$(34)"help"chr$(34)" will cause aredispla";
  122. 820 print"y of this entire list.   help "
  123. 822 print"may be abbreviated with - h":gosub910:ifx$=""thenreturn
  124. 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]"
  125. 826 print"  the "chr$(34)"initialize new"chr$(34)" command will"
  126. 828 print"first format your blank disk currently"
  127. 830 print"in the drive, then it will set up the"
  128. 832 print"proper data files for file cabinet to"
  129. 833 print"use.  use this command only when an un-"
  130. 835 print"formatted disk is in the disk drive."
  131. 836 print"may be abbreviated - i new":gosub910:ifx$=""thenreturn
  132. 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]"
  133. 840 print"  this command will set up the proper"
  134. 842 print"data files for use in file cabinet."
  135. 843 print"  it does not format the entire disk,"
  136. 845 print"therefore it is safe to use with a non-"
  137. 846 print"blank disk.  however, any files saved"
  138. 847 print"through file cabinet will be erased."
  139. 848 print"may be abbreviated - initialize,"
  140. 849 print"i old, or i":gosub910:ifx$=""thenreturn
  141. 850 print"[147]                display[157][157][157][157][157][157][157][197][197][197][197][197][197][197][158]"
  142. 852 print"  the "chr$(34)"display"chr$(34)" command will tell you"
  143. 853 print"the names of all the data files saved"
  144. 855 print"by file cabinet on the floppy diskette"
  145. 856 print"currently in your drive.  the display"
  146. 857 print"abbreviation is - d":gosub910:ifx$=""thenreturn
  147. 859 print"[147]