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

  1. * Program REFCHNGE - Allows changing/deleting reference records
  2. Set exact off
  3. Store ;
  4. 'This routine allows changing a reference record and all its keywords.' to INT
  5. *Store 'CROSSREF  - -  Reference Change Routine' to INH
  6. USE
  7. *Store d+':refindex' to MFILENDX
  8. *Store d+':REFINDKW' to MFILENX
  9. *Store d+':REFERNCE' to MFILE
  10. Select secondary
  11. Use &MFILENDX index &MFILENDX
  12. Select primary
  13. USE &MFILE index &MFILE
  14. store 'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC' to MONTHS
  15. Store 'X' to INSC
  16. Store F to updated
  17. Do while !(INSC)<>'Q'
  18.  Erase
  19.  @ 1,20 say INH
  20.  ? '   ',INT
  21.  ? '    The source reference code is the code of a specific reference article,'
  22.  ? '    as given in the "Reference / Publication INDEX list".'
  23.  ?
  24.  Accept 'Enter the desired source reference code ("Q"=quit)' to INSC
  25.  If !(INSC)<>'Q' .or. len(insc)>1
  26.   Find &INSC
  27.   If #=0
  28.     ? 'Source Code not found in the REFERNCE file.'
  29.   else
  30.     Set colon on
  31.     Store T to updated
  32.     ?
  33.     ? 'TITLE    ',title
  34.     ? 'AUTHOR   ',author
  35.     ? 'SOURCE   ',sourcecode
  36.     ? 'LOCATION ',location
  37.     ?
  38.     Accept '    Delete, or Change? (Enter "D" or "C") ' to ESEL
  39.     Do while !(ESEL)<>'Q' .and. !(ESEL)<>'D' .and. !(ESEL)<>'C' .and. esel<>' '
  40.       Accept '        Illegal entry. Please enter again ' to ESEL
  41.     enddo
  42. Do case
  43. Case !(ESEL)='Q' .or. esel=' '
  44.   Store ' ' to INSC
  45.   ? 'No change will be made.'
  46. Case !(ESEL)='C'
  47.   Set raw off
  48.   Store sourcecode to xsource
  49.   Store T to UPDATED
  50.   Erase
  51.   @ 1,20 say INH
  52.   @ 3,5 say INT
  53.   @ 5,1 say 'TITLE   ' get title
  54.   @ 6,1 say 'AUTHOR  ' get author
  55.   @ 6,40 say 'SOURCE  ' get sourcecode
  56.   @ 7,40 say 'LOCATION' get LOCATION
  57.   @ 8,1 say 'ABSTRACT'
  58.   Store 1 to incntr
  59.   Do while incntr<5
  60.      Store str(incntr,1) to inchr
  61.      If keyw&inchr<>'     '
  62.        Store keyw&inchr to keywd&inchr
  63.      else
  64.        Store '                    ' to keywd&inchr
  65.      endif
  66.      @ incntr+7,12 get text&inchr
  67.      Store incntr+1 to incntr
  68.   enddo
  69.    @ 17,1 say 'KEYWORDS   ' get keyw1
  70.    @ 18,12 get keyw2
  71.    @ 19,12 get keyw3
  72.    @ 20,12 get keyw4
  73.    @ 17,40 get keyw5
  74.    @ 18,40 get keyw6
  75.    @ 19,40 get keyw7
  76.    @ 20,40 get keyw8
  77.    READ
  78.    Store keyw1 to keyword1
  79.    Store keyw2 to keyword2
  80.    Store keyw3 to keyword3
  81.    Store keyw4 to keyword4
  82.    Store keyw5 to keyword5
  83.    Store keyw6 to keyword6
  84.    Store keyw7 to keyword7
  85.    Store keyw8 to keyword8
  86.    Store '                    ' to keyword9
  87.    Store 1 to incntr
  88.    Set exact on
  89.    Store sourcecode to sourcex
  90.    Select secondary
  91.    Find &xsource
  92.    Store 'Y' to M
  93.    Store '1' to N
  94.    If # = 0
  95.    Accept 'No keywords found in keyword file with this source code. OK? ' to M
  96.    Store '9' to N
  97.    Store N to NMAX
  98.    GOTO 1
  99.    endif
  100.    If !(M)='Y'
  101.     Do while sourcecode=xsource .and. .not. EOF
  102.      Store str(#,5) to screc&N
  103.      Store keywordndx to keywd&N
  104.      Replace keywordndx with keyword&N
  105.      If N='9'
  106.        DELETE
  107.      else
  108.       If !(M)='Y' .and. keyword&N='      '
  109.         Store N to M
  110.       endif
  111.       If N='8' .and. !(M)='Y'
  112.         Store '9' to M
  113.       endif
  114.       Store N to NMAX
  115.       Store str(val(N)+1,1) to N
  116.      endif
  117.      SKIP
  118.      Do while *
  119.       SKIP
  120.      enddo
  121.     enddo
  122.     If N<>'1'
  123.       Store N to M
  124.     endif
  125.     If !(M)='Y'
  126.       Store '1' to M
  127.     endif
  128.     Store '0' to N
  129.     GOTO &screc1
  130.     ?
  131.     ? '  SOURCE CODE / KEYWORD CHANGES IN THE REFINDKW.NDX FILE'
  132. ? 'old keyword          old source code   new keyword         new source code'
  133. ? '-----------          ---------------   -----------         ---------------'
  134.     Do while N<NMAX
  135.      Store str(val(N)+1,1) to N
  136.      If SCREC&N<>'0'
  137.       Store screc&N to XX
  138.       GOTO &XX
  139.       ? keywd&N,xsource,'||',keywordndx,sourcex
  140.       replace sourcecode with sourcex
  141.       If keywordndx='    '
  142.         Replace sourcecode with '~'+sourcecode
  143.       endif
  144.      endif
  145.     enddo
  146.     Store M to N
  147.     Do while keyword&N<>'    ' .and. N<>'9'
  148.       Append blank
  149.       Replace SOURCECODE with sourcex
  150.       Replace keywordndx with keyword&N
  151.       ? '                    ',xsource,'||',keywordndx,sourcex
  152.       Store str(val(N)+1,1) to N
  153.     enddo
  154.   endif
  155. ?
  156.   Select primary
  157.   Set exact off
  158. Case !(ESEL)='D'
  159.    ?
  160.    ?   "DELETED SOURCE:",title,author
  161.    ?   'KEYWORDS: '
  162.    REPLACE SOURCECODE WITH '~ '
  163.    DELETE
  164.    SELECT SECONDARY
  165.    Set exact on
  166.    Find &INSC
  167.    DO while #<>0
  168.        ? '    ',keywordndx
  169.        REPLACE SOURCECODE WITH '~~~'
  170.        REPLACE KEYWORDNDX WITH '~~~'
  171.        DELETE
  172.        STORE T TO UPDATED
  173.        Find &INSC
  174.    ENDDO
  175. ENDCASE
  176. Set exact off
  177. endif
  178. Accept 'Entry is complete. Press <retn> to continue ' to XX
  179. endif
  180. enddo
  181. USE
  182. If updated
  183.   Select secondary
  184.   Use &MFILENDX index &MFILENX
  185.   Set talk on
  186.   REINDEX
  187.   Set talk off
  188.   use
  189.   select primary
  190. endif
  191. USE
  192. Release inh,int,mfilendx,updated,months,xx,esel,incntr,inchr,xsource,newkey,M,N
  193. Release inkey,pubcode1,insc,scode,scode1,scode2,mfilenx,screc1,screc2,screc3
  194. Release screc4,screc5,screc6,screc7,screc8
  195. Release keyword1,keyword2,keyword3,keyword4,keyword5,keyword6,keyword7,keyword8
  196. Release keywd1,keywd2,keywd3,keywd4,keywd5,keywd6,keywd7,keywd8,sourcex,NMAX
  197. Release keyword9
  198. RETURN
  199.  
  200.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   REF  - -  Reference Change Routine' to INH
  201. USE
  202. *Store d+':refindex' to MFILENDX
  203. *Store d+':REFINDKW' to MFILENX
  204. *Store d+':REFERNCE' to MFILE
  205. Select secondary
  206. Use &MFILENDX index &MFILENDX
  207. Select primary
  208. USE &MFILE index &MFILE
  209. store 'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC' to MONTHS
  210. Store 'X' to INSC
  211. Store F to updated