home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 11 / 011.d81 / add-del-view (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  3KB  |  145 lines

  1. 10 dimw$(500) ,a$(500), b$(20)
  2. 15 print"[147]this is a repair program for the word-
  3. 17 [153]"smith. wordsmith's memory is composed
  4. 19 print"of many sequential files. this program
  5. 21 [153]"allows you to alter those files by
  6. 23 print"adding or deleting a word. if you wish,
  7. 25 [153]"you may also view the contents of any
  8. 27 print"file. the files are named according to
  9. 29 [153]"first or second letters: the file 's',
  10. 31 print"for example, includes all words begin-
  11. 33 [153]"ning with the letter s; whereas the
  12. 35 print"file '-s' consists of all words with
  13. 37 [153]"second letter s. the program works with
  14. 39 print"or without dos wedge in place."
  15. 41 print"   * * press space bar to begin * *
  16. 42 [161] g$:[139] g$[178]""[167]42
  17. 43 [139] g$[179][177]" " [167]42
  18. 45 [153]"load"
  19. 50 [153]"do you wish to:"
  20. 55 [153]"1) view a file"
  21. 60 [153]"2) add words"
  22. 65 [153]"3) delete a word"
  23. 70 [161] d$:[139]d$[178]""[167]70
  24. 75 [139]d$[178]"1"[167]3050
  25. 80 [139] d$[178]"2"[167]100
  26. 85 [139] d$[179][177]"3"[167]70
  27. 90 [137] 480
  28. 100 [153]"load":[133] "how many words (not more than 20)";m
  29. 101 [153]"load":[129]k[178]1[164]m :[133]"word to add";b$(k):[130] k
  30. 104 [153]:[153]"all correct (y/n)?"
  31. 105 [161]c$:[139]c$[178]""[167]105
  32. 107 [139]c$[178]"n"[167]50
  33. 109 [139]c$[179][177]"y"[167]105
  34. 110 [129] l[178]1[164]m:a$[178]b$(l)
  35. 118 f$[178][200](a$,1):s$[178][202](a$,2,1)
  36. 120 x$[178]"0:"[170]f$[170]",s,r":y$[178]"0:"[170]f$[170]",s,w":z$[178]","
  37. 162 [153]"loadadding ";a$
  38. 163 [153]"reading file "[170]f$
  39. 165 n[178]0:  [159]2,8,2,x$
  40. 170 [132]2,b$:[139]b$[178]"stop"[176]b$[178]""[167][160]2:[137]200
  41. 173 [139]b$[178]a$[167][160]2:[153]"word exists":[129]i[178]1[164]600:[130]i:[137]475
  42. 175 n[178]n[170]1:w$(n)[178]b$
  43. 180 [137]170
  44. 200 w$(n[170]1)[178]a$
  45. 201 [129]i[178]0[164]38:[151]1184[170]i,32:[130]i
  46. 202 [153]"onsorting-do not disturb disk drive!"
  47. 205 [141] 5000
  48. 209 [143]
  49. 210 [129]i[178]0[164]38:[151]1184[170]i,32:[130]i
  50. 215 [153]"onscratching file ";f$
  51. 220 [159]15,8,15:[152]15,"s8:"[170]f$:[160]15
  52. 230 w$(n[170]2)[178]"stop"
  53. 240 [129]i[178]0[164]38:[151]1184[170]i,32:[130]i
  54. 245 [153]"onwriting file ";f$
  55. 250 [159]2,8,2,y$
  56. 260 [129] i [178] 1[164]n[170]2
  57. 270 [152]2,w$(i)
  58. 280 [130]i
  59. 290 [160]2
  60. 300 x$[178]"0:-"[170]s$[170]",s,r":y$[178]"0:-"[170]s$[170]",s,w":z$[178]","
  61. 302 [129]i[178]0[164]38:[151]1184[170]i,32:[130]i
  62. 305 [153]"onreading file -"[170]s$
  63. 365 n[178]0: [159]2,8,2,x$
  64. 370 [132]2,b$:[139]b$[178]"stop"[176]b$[178]""[167][160]2:[137]400
  65. 374 [139] b$[178]a$[167]370
  66. 375 n[178]n[170]1:w$(n)[178]b$
  67. 380 [137]370
  68. 400 w$(n[170]1)[178]a$
  69. 401 [129]i[178]0[164]38:[151]1184[170]i,32:[130]i
  70. 402 [153]"onsorting-do not disturb disk drive!"
  71. 405 [141] 5000
  72. 409 [143]
  73. 410 [129]i[178]0[164]38:[151]1184[170]i,32:[130]i
  74. 415 [153]"onscratching file -"[170]s$
  75. 420 [159]15,8,15:[152]15,"s8:-"[170]s$:[160]15
  76. 430 w$(n[170]2)[178]"stop"
  77. 440 [129]i[178]0[164]38:[151]1184[170]i,32:[130]i
  78. 445 [153]"onwriting file -"[170]s$
  79. 450 [159]2,8,2,y$
  80. 460 [129] i [178] 1[164]n[170]2
  81. 465 [152]2,w$(i)
  82. 470 [130]i
  83. 472 [160]2
  84. 475 [130] l
  85. 476 [153]"backup (y/n)?"
  86. 477 [161]g$:[139]g$[178]""[167]477
  87. 478 [139]g$[178]"n"[167]2000
  88. 479 [139]g$[179][177]"y"[167]477
  89. 480 [153]"put backup disk in drive & hit any key":h$[178]""
  90. 481 [161]h$:[139]h$[178]""[167]481
  91. 482 [137] 110
  92. 485 [153]"load":[133]"word to delete";a$
  93. 490 f$[178][200](a$,1):s$[178][202](a$,2,1)
  94. 495 x$[178]"0:"[170]f$[170]",s,r":y$[178]"0:"[170]f$[170]",s,w":z$[178]","
  95. 500 [153]:[153]"delete ";a$;" (y/n)?"
  96. 502 [161]c$:[139]c$[178]""[167]502
  97. 504 [139]c$[178]"n"[167]2000
  98. 506 [139]c$[179][177]"y"[167]502
  99. 565 n[178]0: [159]2,8,2,x$
  100. 570 [132]2,b$:[139]b$[178]"stop"[176]b$[178]""[167][160]2:[137]610
  101. 575 n[178]n[170]1:w$(n)[178]b$
  102. 580 [137]570
  103. 610 [159]15,8,15:[152]15,"s8:"[170]f$:[160]15
  104. 645 w$(n[170]1)[178]"stop"
  105. 650 [159]2,8,2,y$
  106. 660 [129] i [178] 1[164]n[170]1
  107. 665 [139]w$(i)[178]a$[167]680
  108. 670 [152]2,w$(i)
  109. 680 [130]i
  110. 690 [160]2
  111. 750 x$[178]"0:-"[170]s$[170]",s,r":y$[178]"0:-"[170]s$[170]",s,w":z$[178]","
  112. 765 n[178]0: [159]2,8,2,x$
  113. 770 [132]2,b$:[139]b$[178]"stop"[176]b$[178]""[167][160]2:[137]810
  114. 775 n[178]n[170]1:w$(n)[178]b$
  115. 780 [137]770
  116. 810 [159]15,8,15:[152]15,"s8:-"[170]s$:[160]15
  117. 845 w$(n[170]1)[178]"stop"
  118. 850 [159]2,8,2,y$
  119. 860 [129] i [178] 1[164]n[170]1
  120. 865 [139]w$(i)[178]a$[167]880
  121. 870 [152]2,w$(i)
  122. 880 [130]i
  123. 890 [160]2:[137]2000
  124. 2000 [153]:[153]"another (y/n)?"
  125. 2010 [161]d$:[139]d$[178]""[167]2010
  126. 2020 [139] d$[178]"y"[167]45
  127. 2030 [139]d$[179][177]"n"[167]2010
  128. 2040 [128]
  129. 3050 b$[178]"": [153]"load": n[178]0:  [133]"file to check";a$
  130. 3060 f$[178][200](a$,1):s$[178][202](a$,2,1)
  131. 3070 x$[178]"0:"[170]f$[170]s$[170]",s,r"
  132. 3080 n[178]0: [159]2,8,2,x$:[153]:[153]"current contents of file ";f$[170]s$;":":[153]
  133. 3090 [132]2,b$:[139]b$[178]""[167][160]2:[137]3130
  134. 3100 n[178]n[170]1:w$(n)[178]b$:[153]b$,
  135. 3105 [139]b$[178]"stop"[167][160]2:[153]"":[153]n[171]1;"words":[137] 2000
  136. 3110 [137]3090
  137. 3130 [139] n[178]0[167][153]"no such file"
  138. 3140 [137]2000
  139. 5000 [143]
  140. 5030 [129]j[178]1[164]n
  141. 5040 [139]w$(n[170]1)[177]w$(j)[167][130]j
  142. 5045 v$[178]w$(n[170]1)
  143. 5050 [129] k [178]n[170]1[164]j[170]1[169][171]1:w$(k)[178]w$(k[171]1):[130]k:w$(j)[178]v$
  144. 5070 [142]
  145.