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

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