home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / chrchpr2.zip / MUSICLIB.CMD < prev    next >
OS/2 REXX Batch file  |  1987-01-06  |  7KB  |  251 lines

  1. * Program MUSICLIB - Controls all MUSIC LIBRARY program operations
  2. Clear
  3. Set talk off
  4. Set bell off
  5. Set intensity off
  6.   Store 'January  February March    April    May      June     ' to XX
  7.   Store XX+'July     August   SeptemberOctober  November December ' to MONTHS
  8.   If $(DATE(),7,2) = '00'
  9.     Set date to 01,01,00
  10.   ENDIF
  11.   Store ' ' to curmonthx
  12.   Store ' ' to curyear
  13.   Store ' ' to curmonth
  14.   * Set today's date from current system-date
  15.   Store $(date(),1,2) to curmo
  16.   Store $(date(),7,2) to curmonthx
  17.   Store val(curmo) to nmonth
  18.   Store curmo+curmonthx to indate
  19.   If $(date(),4,1) = '0'
  20.     Store $(DATE(),5,1) to CURMONTHX
  21.   else
  22.     Store $(DATE(),4,2) to CURMONTHX
  23.   endif
  24.   Store trim($(months,NMONTH*9-8,9)) to curmonth
  25.   Store curmonth+' '+curmonthx to curmonthx
  26.   Store ', 19'+$(DATE(),7,2) to CURYEAR
  27.   Store curmonthx+curyear to curdate
  28.   release curmo,months,curyear,curmonthx,nmonth
  29. Select secondary
  30. Use UDIRFILE
  31. GOTO 2
  32. Store !($(spact,21,1)) to D
  33. Store D+':MUSICLIB' to MFILE
  34. Store T to LEVEL1
  35. Do while LEVEL1
  36.   Use
  37.   Select primary
  38.   Use
  39.   Erase
  40.   @ 1,1 say 'DATA DISK = '+D
  41.   @ 1,60 say curdate
  42.   @ 2,20 SAY '    M U S I C L I B                        3-/MUSICLIB/'
  43.   @ 5,13 say ' Makes and Recalls Music Article Summaries '
  44.   @ 7,9 say  ' 1)  Enter new Music Articles                         /REFERNTR/'
  45.   @ 8,9 say  ' 2)  Recall Music by a selected SUBJECT               /REFSELCT/'
  46.   @ 9,9 SAY  ' 3)  Music Library REPORTS                            /REFREPTS/'
  47.   @ 10,9 say ' 4)  Display the MUSICLIB Subject INDEX               /REFDXLST/'
  48.   @ 11,9 say ' 5)  Display the Music Library Codes-Names        '
  49.   @ 12,9 say ' 6)  Update the Music Library Codes-Names             /REFCODES/'
  50.   @ 13,9 say ' 7)  Change/Delete an existing Music Library Name     /REFCHNGE/'
  51.   @ 14,9 say ' 8)  SET UP'                                  '
  52. ?
  53. Accept '         Enter selection' to MSEL
  54. ?
  55. Store F to validd1
  56. If !(msel)='DISK='
  57.   If len(MSEL)>5
  58.     Store !($(MSEL,6,1)) to D
  59.     Store D+':MUSICLIB' to MFILE
  60.     ? 'Disk now being set to drive',D
  61.   endif
  62.   Store 'D' to MSEL
  63. endif
  64. Do while @(MSEL,'12345678QqD')=0
  65.   Accept 'Invalid entry. Please enter again ' to MSEL
  66. enddo
  67. If MSEL<>'8'.and.!(MSEL)<>'Q'
  68.   If file(MFILE)
  69.     Use &MFILE index &MFILE
  70.   else
  71. ? 'File',mfile,'does not exist on the data disk. Perform SET UP to create it.'
  72. ?
  73.   endif
  74. endif
  75. Do CASE
  76.     CASE MSEL = '1'
  77.       Store 'MUSICLIB - New Music Article Entry' to INH
  78.       Store D+':MUSICLIB' to MFILE
  79.       Store D+':MUSINDEX' to mfile1
  80.       Store D+':MUSINDKW' to MFILE3
  81.       Do REFERNTR.CMD
  82.       Store T to validd1
  83.     CASE MSEL = '2'
  84.       Store 'MUSICLIB Music Subject Search' to INH
  85.       Store D+':MUSICLIB' to MFILE
  86.       Store D+':MUSINDEX' to MFILE1
  87.       Store D+':MUSINDKW' to MFILE1NDX
  88.       Do REFSELCT.CMD
  89.     CASE MSEL = '3'
  90.       Store 'MUSICLIB Music' to INH
  91.       Store D+':MUSICLIB' to MFILE
  92.       Do CLIBREPT.CMD
  93.     CASE MSEL = '4'
  94.       Store 'MUSICLIB - Music Reference/Publication INDEX list  ' to INH
  95.       Store D+':MUSINDEX' to MFILE
  96.       STore D+':MUSINDKW' to MFILENDX
  97.       Do REFDXLST.CMD
  98.     CASE MSEL = '5'
  99. Select primary
  100. Use
  101. Select secondary
  102. Store d+':MUSINDEX' to MFILE
  103. Store '~~~' to inx
  104. Use &MFILE index &MFILE
  105. Store # to LTOP
  106. Store '~' to XX
  107.     GOTO bottom
  108.     Do while * .and. sourcecode<>inx .and. sourcecode=XX
  109.       SKIP -1
  110.     enddo
  111.     If sourcecode<>XX
  112.       ? 'No Reference/Publication codes present in the code file.'
  113.     else
  114.         ? 'Music Library Reference/Publication code list   ',curdate
  115.         ?
  116.       If #=LTOP
  117.         ? $(sourcecode,2,2),' :  ',$(keywordndx,2,19)
  118.       else
  119.       Do while sourcecode=XX.and.#<>LTOP
  120.         ? $(sourcecode,2,2),' :  ',$(keywordndx,2,19)
  121.         SKIP -1
  122.         Do while * .and. sourcecode<>inx .and. sourcecode=XX
  123.           SKIP -1
  124.         enddo
  125.       enddo
  126.       endif
  127.     endif
  128. USE
  129. ?
  130. ?
  131. Accept 'End of Music Library Reference/Pub. codes. Press <retn> ' to XX
  132. Select primary
  133. Release ST,inx,xx
  134.     CASE MSEL = '6'
  135.       Store D+':MUSINDEX' to MFILE
  136.       Store D+':MUSINDKW' to MFILENDX
  137. Store 'MUSICLIB Music Reference / Publication code entry routine.' to INH
  138.       Do REFCODES.CMD
  139.     CASE MSEL = '7'
  140.       Store D+':MUSINDEX' to MFILENDX
  141.       Store D+':MUSINDKW' to MFILENX
  142.       Store D+':MUSICLIB' to MFILE
  143.       Store 'MUSICLIB Music Article Change routine.' to INH
  144.       Do REFCHNGE.CMD
  145.     CASE MSEL = '8'
  146. ?
  147. ? '                   MUSICLIB  SET UP'
  148. ?
  149. ? '         1) Build new Library files'
  150. ? '         2) Re-index existing Library files'
  151. ? '         3) Names Directory editing'
  152. ?
  153. Accept '         Enter selection ' to XX
  154. ?
  155. If XX='1'
  156. Accept ;
  157. 'Now about to build new Library files: MUSICLIB.DBF and MUSINDEX.DBF.  OK? ' ;
  158. to XX
  159. If !(XX)='Y'
  160. Use REFERNCX
  161. ? 'Now creating MUSICLIB.DBF file with index = MUSICLIB.NDX'
  162. Store d+':MUSICLIB' to MFILE
  163. Copy to &MFILE
  164. USE &MFILE
  165. Index on sourcecode to &MFILE
  166. Use refindxx
  167. ? 'Now creating MUSINDEX.DBF file for keywords,'
  168. ? 'with indexes = MUSINDEX.NDX and MUSINDKW.NDX'
  169. Store d+':MUSINDEX' to NFILE
  170. Copy to &NFILE
  171. Use &NFILE
  172. Store d+':MUSINDKW' to OFILENDX
  173. Index on keywordndx to &OFILENDX
  174. Index on sourcecode to &NFILE
  175. Use
  176. ? 'New Music Library and index files are now created. '
  177. Accept 'Press <retn> to enter Publication/Reference codes' to XX
  178. STORE 'MUSICLIB Music Reference / Publication code entry routine. ' to INH
  179. Store D+':MUSINDEX' to MFILE
  180. Store D+':MUSINDKW' to MFILENDX
  181. Do REFCODES.CMD
  182. USE
  183. endif
  184. Release nfile,ofilendx
  185. Store '9' to XX
  186. endif
  187. If XX='2'
  188.       Select secondary
  189.       Use
  190.       Select primary
  191.       Store d+':MUSICLIB' to MFILE
  192.       Use &MFILE
  193.       ? 'Now re-indexing MUSICLIB file by SOURCECODE.'
  194.       Set talk on
  195.       Index on sourcecode to &MFILE
  196.       Set talk off
  197.       Store d+':MUSINDEX' to MFILE1
  198.       Use &MFILE1
  199.       ? 'Now re-indexing MUSINDEX file by SOURCECODE.'
  200.       Set talk on
  201.       Index on sourcecode to &MFILE1
  202.       Set talk off
  203.       Store d+':MUSINDKW' TO MFILE2
  204.       ? 'Now re-indexing MUSINDEX file by KEYWORDNDX.'
  205.       Set talk on
  206.       Index on keywordndx to &MFILE2
  207.       Set talk off
  208.       Accept 'Re-building is complete. Press <RETURN>' to XX
  209.       Release MFILE1,MFILE2
  210.       Use
  211. endif
  212. If XX='3'
  213.   @ 17,0
  214.   @ 18,0
  215.   @ 19,0
  216.   @ 20,0
  217.   @ 21,0
  218.   @ 22,0
  219.   @ 16,0
  220.   ? '            Names Directory editing'
  221.   Store D to DD
  222.   @ 19,9 say 'Data disk drive ' get DD
  223.   ?
  224.   READ
  225.   ? 'Now saving the new Data Disk Drive designator.'
  226.   Select secondary
  227.   Use UDIRFILE
  228.   GOTO 2
  229.   Replace spact with $(spact,1,20)+!(DD)
  230.   Store DD to D
  231.   Use
  232.   Select primary
  233. endif
  234.     CASE !(MSEL) = 'Q'
  235.       Select secondary
  236.       USE
  237.       Select primary
  238.       USE
  239.       Store F to LEVEL1
  240.   ENDCASE
  241. ENDDO
  242. Store T to LEVEL1
  243. RETURN
  244. m
  245.     Do while * .and. sourcecode<>inx .and. sourcecode=XX
  246.       SKIP -1
  247.     enddo
  248.     If sourcecode<>XX
  249.       ? 'No Reference/Publication codes present in the code file.'
  250.     else
  251.         ? 'Music Library Reference/Publicatio