home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / DATABASE / KPHANDYP.LBR / FILECABS.CZD / FILECABS.CMD
OS/2 REXX Batch file  |  2000-06-30  |  5KB  |  239 lines

  1. USE filecabs index filecabs
  2. IF val(option)>0
  3. @ 18,0
  4. @ 16,0
  5. ENDI
  6. STOR T to cabinets
  7. DO WHIL cabinets
  8. SET intensity off
  9. @ 3,54 say chr(27)+chr(66)+chr(50)
  10. @ 3,54 say 'FILING CABINET SUBSYSTEM'
  11. @ 3,78 say chr(27)+chr(67)+chr(50)
  12. SET intensity on
  13. @ 5,50 say 'A - Log alternate disk/cabinet'
  14. @ 6,50 say 'B - Display folders in cabinet'
  15. @ 7,50 say 'C - Browse/edit files database'
  16. @ 8,50 say 'D - Display the disk directory'
  17. @ 9,50 say 'E - Delete file from directory'
  18. @ 14,50 say 'R - Return to main system menu'
  19. SET intensity off
  20. IF val(option)>0
  21. @ 16,54 say "Option (0-9; A-E or R)? "
  22. SET console off
  23. WAIT to option
  24. SET console on
  25. IF val(option)>0 .or. option='0'
  26. DO changeop
  27. RETU
  28. ENDI
  29. ELSE
  30. @ 16,54 say "Option (A-E or R)? "
  31. SET console off
  32. WAIT to option
  33. SET console on
  34. ENDI
  35. DO CASE
  36. CASE !(option)='A'
  37. ERAS
  38. USE
  39. RESE
  40. STOR T to filecabs
  41. STOR F to cabinets
  42. STOR F to handy
  43. CASE !(option)='B'
  44. STOR T to filefold
  45. DO WHIL filefold
  46. ERAS
  47. SET intensity on
  48. @ 17,0 say '-------------------------------------------------------------------------------'
  49. SET intensity off
  50. @ 18,0 say 'Enter one of the following single letter commands:'
  51. SET intensity on
  52. @ 19,0 say 'A)dd   E)dit   P)age   Q)uit   R)estart   S)elect'
  53. GOTO top
  54. @ 2,0
  55. @ 2,0 say 'FILE CABINET FOLDERS'
  56. SET intensity off
  57. STOR 4 to line
  58. STOR 2 to column
  59. STOR # to number
  60. DO WHIL line<15 .and. .not. eof
  61. IF document='FOLDER'
  62. @ line,column say foldname
  63. STOR column+20 to column
  64. IF column>62
  65. STOR line+2 to line
  66. ENDI
  67. ENDI
  68. SKIP
  69. ENDD
  70. STOR ' ' to action
  71. DO WHIL !(action)#'Q' .and. !(action)#'P'
  72. @ 20,0
  73. WAIT to action
  74. IF !(action)='A'
  75. STOR '               ' to title
  76. @ 22,0
  77. @ 22,0 say 'Please enter new folder title ';
  78. get title picture 'XXXXXXXXXXXXXXX'
  79. READ
  80. IF line<15 .and. column<63
  81. @ line,column say title
  82. STOR column+20 to column
  83. IF column>62
  84. STOR line+2 to line
  85. ENDI
  86. ENDI
  87. GOTO bottom
  88. APPE BLAN
  89. REPL foldname with title,document with 'FOLDER',doc:date with holddate
  90. GOTO number
  91. @ 22,0
  92. ENDI
  93. IF !(action)='E'
  94. GOTO top
  95. BROW
  96. PACK
  97. GOTO number
  98. ENDI
  99. IF !(action)='R'
  100. GOTO top
  101. STOR 'P' to action
  102. ENDI
  103. IF !(action)='P'
  104. @ 22,0
  105. STOR 4 to line
  106. DO WHIL line<15
  107. @ line,0
  108. STOR line+1 to line
  109. ENDD
  110. ENDI
  111. IF !(action)='Q'
  112. STOR F to filefold
  113. ENDI
  114. IF !(action)='S'
  115. STOR '               ' to title
  116. @ 19,42
  117. @ 22,0
  118. @ 22,0 say 'Please enter name of selected file folder ';
  119. get title picture 'XXXXXXXXXXXXXXX'
  120. READ
  121. STOR 4 to line
  122. DO WHIL line<15
  123. @ line,0
  124. STOR line+1 to line
  125. ENDD
  126. SET intensity on
  127. @ 2,0 say 'DOCUMENT FOLDER - '+!(title)
  128. SET intensity off
  129. GOTO top
  130. @ 3,0
  131. DISP next 12 document,doc:date,filename for foldname=!(title)
  132. STOR ' ' to op
  133. DO WHIL !(op)#'Q'
  134. IF !(op)#'P'
  135. @ 22,0
  136. @ 20,0
  137. WAIT to op
  138. ENDI
  139. IF !(op)='A'
  140. APPE BLAN
  141. REPL foldname with !(title)
  142. SET intensity on
  143. EDIT #
  144. IF doc:date=' '
  145. REPL doc:date with holddate
  146. ENDI
  147. ELSE
  148. IF !(op)='E'
  149. STOR 0 to recnum
  150. @ 22,0
  151. @ 20,0
  152. INPU 'Enter number to left of record to edit' to recnum
  153. GOTO recnum
  154. SET intensity on
  155. EDIT #
  156. ELSE
  157. IF !(op)='P' .or. !(op)='R'
  158. IF eof .or. !(op)='R'
  159. GOTO top
  160. ENDI
  161. @ 3,0
  162. DISP next 12 document,doc:date,filename for foldname=!(title)
  163. STOR ' ' to op
  164. ELSE
  165. @ 22,0
  166. STOR 'Q' to action
  167. ENDI p
  168. ENDI e
  169. ENDI a
  170. IF !(op)='A' .or. !(op)='E'
  171. ERAS
  172. SET intensity on
  173. @ 2,0 say 'DOCUMENT FOLDER - '+!(title)
  174. @ 17,0 say '-------------------------------------------------------------------------------'
  175. SET intensity off
  176. @ 18,0 say 'Enter one of the following single letter commands:'
  177. SET intensity on
  178. @ 19,0 say 'A)dd   E)dit   P)age   Q)uit   R)estart'
  179. STOR 'P' to op
  180. ENDI
  181. ENDD
  182. ENDI
  183. ENDD
  184. ENDD
  185. CASE !(option)='C'
  186. GOTO top
  187. BROW
  188. PACK
  189. CASE !(option)='D'
  190. ERAS
  191. STOR '            ' to type
  192. @ 2,0 say 'Please enter complete file name (wildcards are accepted)';
  193. get type picture 'XXXXXXXXXXXX'
  194. READ
  195. ERAS
  196. ?
  197. ? 'Current files on disk in drive B of name/type '+trim(type)+' are -'
  198. ?
  199. DISP files like &type
  200. ?
  201. ? 'Press RETURN to return to menu...'
  202. SET console off
  203. WAIT to return
  204. SET console on
  205. CASE !(option)='E'
  206. ERAS
  207. STOR '            ' to type
  208. @ 2,0 say 'Please enter complete file name';
  209. get type picture 'XXXXXXXXXXXX'
  210. READ
  211. DELE file &type
  212. CASE !(option)='R'
  213. STOR F to cabinets
  214. RELE filecabs
  215. ENDC
  216. IF !(option)#'R'
  217. ERAS
  218. ? '.______________.______________.'
  219. ? '|              |              |'
  220. ? '|     :--:     |     :--:     |'
  221. ? '|              |              |'
  222. ? '|              |              |'
  223. ? '|              |              |'
  224. ? '|--------------|--------------|'
  225. ? '|              |              |'
  226. ? '|     :--:     |     :--:     |'
  227. ? '|              |              |'
  228. ? '|              |              |'
  229. ? '|______________|______________|'
  230. ? '|              |              |'
  231. ? '|     :--:     |     :--:     |'
  232. ? '|              |              |' 
  233. ? '|              |              |'
  234. ? '|______________|______________|'
  235. ? '!______________!______________!'
  236. ENDI
  237. ENDD
  238. RETU
  239.