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

  1. * Program REFCODES - Displays/updates 2-character Ref/Publications codes
  2. Store F to updated
  3. Select primary
  4. Use
  5. Select secondary
  6. *Store d+':REFINDEX' to MFILE
  7. *Store d+':REFINDKW' to MFILENDX
  8. Use &MFILE index &MFILE
  9.   ERASE
  10.   @ 2,9 say INH
  11.   ?
  12.   ?
  13.   Store T to morentries
  14.   Do while morentries
  15.     Accept 'Enter 2-character Ref./Pub. code ("Q"=quit) ' to PUBCODE
  16.     Store T to invalid2
  17.     Do while invalid2
  18.       If len(pubcode)=1 .and. !(PUBCODE)='Q'
  19.         Store F to invalid2
  20.         Store F to morentries
  21.       else
  22.         If len(pubcode)<>2
  23.           Accept 'Not 2 characters. Please enter again ' to PUBCODE
  24.         else
  25.           Store '~'+!(PUBCODE) to pubcode1
  26.           Store $(pubcode,1,2) to pubcd
  27.           Find &pubcode1
  28.           If #<>0
  29.             Accept 'Duplicate found. Enter again ' to PUBCODE
  30.           else
  31.             Store F to invalid2
  32.           endif
  33.         endif
  34.       endif
  35.     enddo
  36.     If morentries
  37.       Accept 'Reference / Publication Name ' to keywndx
  38.       ? 'Now saving Ref./Pub. = ',pubcd,': ',keywndx
  39.       Accept 'Ok? ' to XY
  40.       If !(XY)='Q'
  41.         Store F to invalid2
  42.         Store F to morentries
  43.       else
  44.        If !(XY)='Y'
  45.         Store T to updated
  46.         Append blank
  47.         Replace sourcecode with PUBCODE1
  48.         Replace keywordndx with '~'+keywndx
  49.        endif
  50.       endif
  51.     endif
  52.   enddo
  53. USE
  54. If updated
  55.   USE &MFILE index &MFILENDX
  56.   Set talk on
  57.   REINDEX
  58.   Set talk off
  59. endif
  60. Select secondary
  61. USE
  62. Select primary
  63. Use
  64. Release updated,mfilendx,morentries,invalid2,pubcode1,pubcode,pubcd,keywndx,xy
  65. RETURN
  66.  
  67. econdary
  68. *Store d+':REFINDEX' to MFILE
  69. *Store d+':REFINDKW' to MFILENDX
  70. Use &MFILE index &MFILE
  71.   ERASE
  72.   @ 2,9 say INH
  73.   ?
  74.   ?
  75.   Store T to morentries
  76.   Do while morentries
  77.     Accept 'Enter 2-character Ref./Pub. code ("Q"=quit) ' to PUBCODE
  78.     Store T to invalid2
  79.     Do while invalid2
  80.       If len(pubcode)=1 .and. !(PUBCODE)='Q'
  81.         Store F to invalid2
  82.         Store F to morentries
  83.