home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / mbug / mbug061.arc / LIBRARY.DOC < prev    next >
Text File  |  1979-12-31  |  22KB  |  757 lines

  1. 
  2.                 LIBRARY CROSS-REFERENCING SYSTEM
  3.  
  4.                              Sample
  5. 
  6.  
  7. Description of the system:
  8.  
  9.      Thi≤á systeφ allow≤ thσ use≥ t∩ storσ reference≤ t∩á journa∞ ì
  10. article≤ anΣ books¼á alonτ witΦ ß lis⌠ oµ keyword≤ (subjects⌐ fo≥ ì
  11. eacΦá reference«á  I⌠ automaticall∙ maintain≤ ß "historyó oµá al∞ ì
  12. thσá keyword≤á tha⌠ arσ iε thσ database«á  Ne≈ addition≤á t∩á thσ ì
  13. database¼á anΣ change≤ t∩ thσ database¼á automaticall∙ updatσ thσ ì
  14. keyword≤ database«á  Thσ use≥ caε displa∙ ß lis⌠ oµ al∞ availablσ ì
  15. keywords¼á anΣá caεá als∩ searcΦ fo≥ reference≤ tha⌠ contaiεá an∙ ì
  16. given keyword, or group of keywords. 
  17.  
  18.  
  19. Databases and Index Files:
  20.  
  21.      Thσá maiε databasσ i≤ calleΣ LIBRARY.DAT¼á anΣ i⌠á ha≤á thi≤ ì
  22. structure:
  23. 
  24. STRUCTURE FOR FILE:  B:LIBRARY .DBF
  25. NUMBER OF RECORDS:   00005
  26. DATE OF LAST UPDATE: 00/00/00
  27. PRIMARY USE DATABASE
  28. FLD       NAME      TYPE WIDTH   DEC
  29. 001     AUTHOR       C    040          
  30. 002     TITLE        C    040          
  31. 003     PUB          C    030          
  32. 004     DATE         C    008          
  33. 005     PAGES        C    008          
  34. 006     ABSTRACT     C    254          
  35. 007     KEYWORDS     C    080          
  36. ** TOTAL **             00461
  37. 
  38. Tw∩ inde° file≤ arσ maintaineΣ a⌠ al∞ times«  Thσ firs⌠ maintain≤ ì
  39. aεá alphabetica∞á listinτ b∙ autho≥ anΣ title«á  Thi≤á inde°á wa≤ ì
  40. created with the command:
  41. 
  42. INDEX ON AUTHOR+TITLE TO AUTHORS
  43. 
  44. Thσ seconΣ inde° maintain≤ ß chronologica∞ order«  Sincσ thσ DAT┼ ì
  45. i≤á storeΣ iε MM/DD/Y┘ fashion¼á thσ inde° filσ wa≤ createΣá sucΦ ì
  46. tha⌠á thσ yea≥ i≤ oµ greate≥ importancσ thaε thσ montΦ anΣá date«  ì
  47. Hence¼ thi≤ inde° wa≤ createΣ witΦ thσ command:
  48. INDEX ON $(DATE,7,2)+$(DATE,1,5) TO DATES
  49. Thσá seconΣ databasσ maintain≤ ß histor∙ oµ al∞ keyword≤ useΣá iε ì
  50. thσá maiε database¼á a≤ wel∞ a≤ ß counte≥ oµ ho≈ man∙ record≤á iε ì
  51. thσá maiεá databasσá usσá eacΦá keyword«áá  Thσá filσá i≤á calleΣ ì
  52. KEYWORDS.DBF¼ anΣ i⌠ has thi≤ structure:
  53. 
  54.  
  55. èSTRUCTURE FOR FILE:  B:KEYWORDS.DBF
  56. NUMBER OF RECORDS:   00010
  57. DATE OF LAST UPDATE: 00/00/00
  58. PRIMARY USE DATABASE
  59. FLD       NAME      TYPE WIDTH   DEC
  60. 001     KEYWORD      C    020          
  61. 002     KEYNO        N    004          
  62. ** TOTAL **             00025
  63. 
  64. This file is indexed on the keywords field, using the command:
  65. 
  66. INDEX ON KEYWORD TO KEYWORDS
  67.  
  68. Software Structure
  69.  
  70.      The command files are structured as follows:
  71.                          _______________
  72.                          | LIBRARY.CMD |
  73.                          |             |                 
  74.                          | Main Menu   |
  75.                          |_____________|
  76.                                 |
  77.            -------------------------------------------
  78.      ______|________  __________|_________   ________|______
  79.      | LIBADD.CMD  |  | LREPORTS.CMD     |   |LIBEDIT.CMD  |
  80.      | Add new data|  | Present sort,    |   | Allow edits,|
  81.      | and update  |  | search, and      |   | and update  |
  82.      | keyword list|  | report options,  |   | the keyword |
  83.      _______________  | and print report |   | file.       |
  84.                       |__________________|   |_____________|
  85.                                 |                    |
  86.                       __________|_________   ________|______
  87.                       | LIBFIND.CMD       |  | LIBED2.CMD  | 
  88.                       | Search for and    |  | Display Edit|
  89.                       | display references|  | screen and  |
  90.                       | by subject.       |  | allow edits |
  91.                       |___________________|  |_____________|
  92.  
  93.  
  94. User-Interface
  95.  
  96.      Wheε t∩ use≥ call≤ u≡ thσ LIBRAR┘ system¼á i⌠ firs⌠ present≤ ì
  97. the Main Menu, as below:
  98. 
  99.  
  100.                     Library System Main Menu
  101.  
  102.                   1. Add new references
  103.                   2. Print Reports
  104.                   3. Edit References
  105.  
  106.                   4. Exit
  107.  
  108.                    Enter choice (1-4) 
  109. è     Iµá thσ use≥ wishe≤ t∩ AdΣ ne≈ references¼á hσ i≤á presenteΣ ì
  110. with a custom "APPEND" screen, as below:
  111.  
  112. 
  113. Record No. 1   Enter new Data, ^Q to Quit
  114. ----------------------------------------------------------
  115. Author:                    :
  116. Title :                             :
  117. Pub.  :                    :
  118. Date  : :          :       Pages :        :
  119.  
  120. Abstract:
  121.  
  122.             :
  123. Keyword 1 :                       :
  124. Keyword 2 :                       :
  125. Keyword 3 :                       :
  126. Keyword 4 :                       :
  127. Keyword 5 :                       :
  128. Keyword 6 :                       :
  129. Keyword 7 :                       :
  130. ---------------------------------------------------------
  131. 
  132.       Iµ thσ use≥ want≤ t∩ Prin⌠ Reports¼á thσ screeε ask≤ iµá hσ ì
  133. wishe≤á t∩á prin⌠á keyword≤ o≥ references«á  Iµ thσá use≥á selec⌠ ì
  134. keywords¼á theε thσ keyworΣ filσ i≤ displayed¼ alphabetically¼ iε ì
  135. two columns, as below:
  136.                 BANK                 PERFORMANCE          
  137.                 DBASE II             PRIMARY              
  138.                 DISK DRIVES          ROBBERS              
  139.                 DOG BISCUITS         SECONDARY            
  140.                 MULTIPLE FILES       UPDATE               
  141.  
  142. 
  143.      If the user wishes to see references, the screen first asks:   
  144.    
  145.  
  146. 
  147.  How do you want references sorted?  
  148.  
  149.      1. Alphabetically by Author  
  150.      2. Chronologically by Date 
  151.      3. Original Order 
  152. 
  153. Then¼á thσ use≥ caε typσ iε thσ subject≤ hσ wishe≤ t∩ searcΦ for¼ ì
  154. in a screen as below:
  155.  
  156. Keyword 1 :                       :
  157. Keyword 2 :                       :
  158. Keyword 3 :                       :
  159. Keyword 4 :                       :
  160. Keyword 5 :                       :
  161. Keyword 6 :                       :
  162. Keyword 7 :                       :
  163. è
  164.  
  165. Iµá thσá use≥ request≤ t∩ searcΦ oε morσ thaεá onσá keyword¼á thσ ì
  166. screeε ask≤ iµ thσ use≥ want≤ reference≤ witΦ AL╠ o≥ AN┘ keyword«  ì
  167. Then¼á thσá appropriatσá reference≤ arσ displayeΣ iεá thσá forma⌠ ì
  168. below:
  169.  
  170. 
  171. Author: Blaine, Appy                             
  172. Title : Dog Biscuits in your Disk Drives         
  173. Pub.  : Data Based Advisor             
  174. Date  : 01/01/83         Pages :  12-345   
  175.  
  176. Keywords :  DBASE II, DISK DRIVES, DOG BISCUITS,                                            
  177. Abstract :  
  178. A complete listing of items not to put into your disk 
  179. drives.  Includes mention of those sticky little yellow 
  180. "Post-It" pads, which tend to disable drive B on many 
  181. computers.  However, dog biscuits are the ultimates no-no 
  182. for putting into floppy drives. 
  183.  
  184. 
  185.      Edit≤á arσ handleΣ b∙ askinτ thσ use≥ fo≥ thσ las⌠á namσá oµ ì
  186. thσá maiε autho≥ oµ thσ referencσ t∩ edit«á  Iµ therσ i≤ n∩á sucΦ ì
  187. author¼ thσ use≥ i≤ tolΣ so«  Iµ therσ arσ numerou≤ reference≤ b∙ ì
  188. thi≤á author¼á theε thosσ arσ displayeΣ anΣ thσ use≥ i≤ askeΣá t∩ ì
  189. selec⌠á b∙ recorΣ number«á  Oncσ thσ referencσ t∩ edi⌠ i≤á found¼ ì
  190. thσá referencσá i≤á displayeΣ oε thσ screeε iε exactl∙á thσá samσ ì
  191. forma⌠ a≤ thσ APPEN─ format¼ anΣ thσ use≥ caε makσ changes.
  192.  
  193. Program Listings
  194.  
  195.      The programs used in the LIBRARY system are displayed below:
  196. 
  197. ********************************** LIBRARY.CMD
  198. ******************** Library System Main Menu.
  199. ******************** The LIBRARY System maintains
  200. ******************** a history and count of all 
  201. ******************** keywords used in the LIBRARY
  202. ******************** database.
  203. SET TALK OFF
  204. SET DEFA TO B
  205. STORE 0 TO CHOICE
  206.  
  207. *************************** Display Main Menu.
  208. DO WHILE CHOICE <> 4
  209.    ERASE
  210.    TEXT
  211.                     Library System Main Menu
  212.  
  213.                   1. Add new references
  214.                   2. Print Reports
  215.                   3. Edit References
  216.  
  217.                   4. Exitè   ENDTEXT
  218.    INPUT "                   Enter choice (1-4) " TO CHOICE
  219.  
  220.  
  221.    **************** Branch to appropriate procedure 
  222.    **************** based upon choice.
  223.  
  224.    DO CASE
  225.  
  226.       CASE CHOICE = 1
  227.            DO LIBADD
  228.  
  229.       CASE CHOICE = 2
  230.            DO LREPORTS
  231.  
  232.       CASE CHOICE = 3
  233.            DO LIBEDIT
  234.  
  235.     ENDCASE
  236.  
  237. ENDDO (while choice # 4)
  238. 
  239.  
  240. Here is LIBADD.CMD, used for adding new records.
  241.  
  242. 
  243. *************************************** LIBADD.CMD
  244. *************************************** Add new data.
  245. ************** Open Data Files
  246. SELECT PRIMARY
  247. USE LIBRARY INDEX AUTHORS,DATES
  248. SELECT SECONDARY
  249. USE KEYWORDS INDEX KEYWORDS
  250. SET EXACT ON
  251. ************** Initialize memory variables.
  252. STORE "               " TO K1,K2,K3,K4,K5,K6,K7
  253.  
  254. SELECT PRIMARY
  255. GO BOTT
  256. DO WHILE AUTHOR <> " " .OR. # <= 1
  257.    ************ Display custom APPEND screen, (which
  258.    ************ was created with ZIP).
  259.    ERASE
  260.    APPEND BLANK
  261.    @  1, 3 SAY "Record No. "+STR(#,3)+" Enter new Data, ^Q to Quit"
  262.    @  2, 0 SAY "--------------------------------------------------"
  263.    @  2,50 SAY "------------------------------"
  264.    @  4, 3 SAY "Author"
  265.    @  4,12 GET AUTHOR
  266.    @  5, 3 SAY "Title"
  267.    @  5,12 GET TITLE
  268.    @  6, 3 SAY "Pub."
  269.    @  6,12 GET PUB
  270.    @  7, 3 SAY "Date"
  271.    @  7,12 GET DATE PICT "99/99/99"è   @  7,26 SAY "Pages"
  272.    @  7,32 GET PAGES
  273.    @  9, 3 SAY "Abstract"
  274.    @  9,12 GET ABSTRACT
  275.    @ 13, 3 SAY "Keyword 1"
  276.    @ 13,13 GET K1
  277.    @ 14, 3 SAY "Keyword 2"
  278.    @ 14,13 GET K2
  279.    @ 15, 3 SAY "Keyword 3"
  280.    @ 15,13 GET K3
  281.    @ 16, 3 SAY "Keyword 4"
  282.    @ 16,13 GET K4
  283.    @ 17, 3 SAY "Keyword 5"
  284.    @ 17,13 GET K5
  285.    @ 18, 3 SAY "Keyword 6"
  286.    @ 18,13 GET K6
  287.    @ 19, 3 SAY "Keyword 7"
  288.    @ 19,13 GET K7
  289.    @ 21, 0 SAY "--------------------------------------------------"
  290.    @ 21,50 SAY "------------------------------"
  291.    READ
  292.  
  293.  
  294.    ****************** ONLY perform this step if not exiting this program.
  295.    IF AUTHOR <> " "
  296.  
  297.       ****************** Update the Keyword File.
  298.       SELECT SECONDARY
  299.       STORE " " TO TEMPKEY
  300.       STORE 1 TO COUNT
  301.       STORE STR(COUNT,1) TO MAC
  302.  
  303.       DO WHILE K&MAC <> " " .AND. COUNT < 8
  304.          STORE !(K&MAC) TO K&MAC
  305.          FIND &K&MAC
  306.          IF # > 0
  307.             REPLACE KEYNO WITH KEYNO+1
  308.          ELSE
  309.             APPEND BLANK
  310.             REPLACE KEYWORD WITH K&MAC
  311.             REPLACE KEYNO WITH 1
  312.          ENDIF (# > 0)
  313.          *** Put keyword into temporary TEMPKEY string.
  314.          STORE TEMPKEY+TRIM(K&MAC)+", " TO TEMPKEY
  315.  
  316.          **** Clear out K&MAC memory variables, and increment count.
  317.          STORE "               " TO K&MAC
  318.          STORE COUNT +1 TO COUNT
  319.          STORE STR(COUNT,1) TO MAC
  320.       ENDDO (k&mac<>" ")
  321.  
  322.    ENDIF [not exiting this program (author <> "")]
  323.  
  324.  
  325. SELECT PRIMARYè*********************** Put tempkey into keywords on Primary file.
  326. REPLACE KEYWORDS WITH TEMPKEY
  327.  
  328. ENDDO (while author <> " ")
  329.  
  330. *********************** Get rid of any "blank" records.
  331. DELETE ALL FOR AUTHOR = " " .AND. TITLE = " "
  332. PACK
  333. *********************** Return to Main Menu.
  334. SET EXACT OFF
  335. RETURN
  336. 
  337.  
  338.  
  339. LREPORTS, below, presents options for, and prints reports.
  340.  
  341. 
  342. **************************** LREPORTS.CMD
  343. ********** Asks user if they want keyword
  344. ********** listing or to search references
  345. ********** By subjects.  Provides the keyword
  346. ********** listing, branches to LIBFIND for
  347. ********** search by subject.
  348.  
  349. ERASE
  350. STORE " " TO RCHOICE
  351. @ 5,10 SAY " Which Report do you want "
  352. @ 7, 5 SAY "1. Keyword Listing"
  353. @ 8, 5 SAY "2. References by Subject"
  354. @ 10,8 SAY "Enter choice (1-2) " GET RCHOICE 
  355. READ
  356.  
  357. *********** Do appropriate report based upon user's request.
  358. DO CASE
  359.  
  360.    CASE RCHOICE = "1"
  361.       ******* Ask about hardcopy
  362.       ERASE
  363.       STORE " " TO LP
  364.       @ 5,10 SAY " Send Keywords to printer (Y/N) " GET LP
  365.       READ
  366.  
  367.       IF !(LP)="Y"
  368.          *SET PRINT ON
  369.       ENDIF (lp=y)
  370.  
  371.       *********** print keywords in two alphabetized columns.
  372.       ERASE
  373.       USE KEYWORDS
  374.       GO BOTT
  375.       STORE (#+1)/2 TO MIDDLE
  376.       STORE 1 TO COUNTER
  377.       USE KEYWORDS INDEX KEYWORDS
  378.       STORE "Y" TO OK
  379.       DO WHILE COUNTER <= MIDDLE .AND. !(OK)="Y" è         ? KEYWORD
  380.          SKIP MIDDLE
  381.          IF .NOT. EOF
  382.             ?? KEYWORD
  383.             SKIP -1*MIDDLE-1
  384.          ENDIF (not eof)
  385.          STORE COUNTER + 1 TO COUNTER
  386.   
  387.          ************** If keyword list going to the screen,
  388.          ************** Pause every 20 lines.
  389.          IF COUNTER/20 = INT(COUNTER/20) .AND. !(LP) <> "Y"
  390.             ?
  391.             ?
  392.             ? " Continue? (Y/N) "
  393.             WAIT TO OK
  394.          ENDIF (counter/20 and not lp)
  395.  
  396.          ************* If keyword list going to the 
  397.          ************* printer, eject page every 60 lines.
  398.          IF COUNTER/60 = INT(COUNTER/60) .AND. !(LP) = "Y"
  399.             EJECT
  400.          ENDIF (counter/60 and lp)      
  401.  
  402.  
  403.     ENDDO (counter and ok)
  404.     
  405.     ************* If keyword list going to the screen, pause
  406.     ************* before returning to the main menu.
  407.     IF !(LP) <> "Y"
  408.        ?
  409.        ?
  410.        ? " Press any key to return to main menu..."
  411.        WAIT
  412.     ENDIF (lp <> y)
  413.  
  414.     CASE RCHOICE = "2"
  415.          DO LIBFIND
  416.  
  417. ENDCASE
  418. RETURN
  419. 
  420.  
  421. Thσá LIBFIN─á commanΣ filσ fin≤ anΣ display≤á record≤á tha⌠á havσ ì
  422. subjects in common.
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433. è
  434. *********************************** LIBFIND.CMD
  435. ********** Pull out records with certain subjects.
  436.  
  437. ********** First, ask for sort order.
  438. ERASE
  439. STORE 1 TO ORDER
  440. ?
  441. ? " How do you want references sorted? "
  442. ?
  443. ? "     1. Alphabetically by Author "
  444. ? "     2. Chronologically by Date"
  445. ? "     3. Original Order"
  446.  
  447. @ 9,4 SAY "Enter choice (1-3) " GET ORDER PICT "9"
  448. READ
  449.  
  450. *********** Use appropriate index.
  451. DO CASE
  452.  
  453.    CASE ORDER = 1
  454.         USE LIBRARY INDEX AUTHORS
  455.  
  456.    CASE ORDER = 2
  457.         USE LIBRARY INDEX DATES
  458.  
  459.    CASE ORDER = 3
  460.         USE LIBRARY
  461.  
  462.    OTHERWISE
  463.         RETURN
  464.  
  465. ENDCASE
  466.  
  467. ************************* Next, get search criteria.
  468. ERASE
  469. STORE "                 " TO K1,K2,K3,K4,K5,K6,K7,K8
  470. @ 3,5 SAY "Keyword 1 " GET K1
  471. @ 4,5 SAY "Keyword 2 " GET K2
  472. @ 5,5 SAY "Keyword 3 " GET K3
  473. @ 6,5 SAY "Keyword 4 " GET K4
  474. @ 7,5 SAY "Keyword 5 " GET K5
  475. @ 8,5 SAY "Keyword 6 " GET K6
  476. @ 9,5 SAY "Keyword 7 " GET K7
  477. READ
  478.  
  479. *********************** Count how many keywords to search on.
  480. *********************** and store to the variable kcount.
  481. STORE 0 TO KCOUNT
  482. STORE "1" TO MAC
  483. DO WHILE K&MAC <> " "
  484.    STORE KCOUNT+1 TO KCOUNT
  485.    STORE STR(KCOUNT+1,1) TO MAC
  486. ENDDO
  487. è
  488. ************** Now, set up search condition into 
  489. ************** a memory variable called CND.
  490.  
  491. ************** First, set up initial search condition.
  492. STORE CHR(34)+" "+!(TRIM(K1))+","+CHR(34)+" $KEYWORDS" TO CND
  493.  
  494.  
  495. ************** If many keywords to search on,
  496. ************** ask about the logic of the search.
  497. STORE "0" TO LOGIC
  498. IF KCOUNT > 1
  499.    ?
  500.    @ 12,2 SAY " References with 1) ALL keywords or 2) ANY keyword " GET LOGIC
  501.    READ
  502.    IF LOGIC = "1"
  503.       STORE " .AND. " TO LOGIC
  504.    ELSE
  505.       STORE " .OR. " TO LOGIC
  506.    ENDIF (logic=1)
  507.  
  508.    *********** Then finish the 'condition' string (CND).
  509.    STORE 2 TO COUNT
  510.    DO WHILE COUNT <= KCOUNT
  511.       STORE STR(COUNT,1) TO MAC
  512.       STORE CND+LOGIC+CHR(34)+" "+!(trim(K&MAC))+","+CHR(34)+;
  513.       " $KEYWORDS" TO CND
  514.       STORE COUNT+1 TO COUNT
  515.    ENDDO (count <=kcount)
  516.  
  517. ENDIF (kcount > 1)
  518.  
  519. *********** Ask about hardcopy.
  520. ERASE
  521. STORE " " TO LP
  522. @ 5,5 SAY " Send report to printer (Y/N) " GET LP
  523. READ
  524.  
  525. ************ Prepare printer if necessary.
  526. IF !(LP)="Y"
  527.    @ 7,5 SAY "Ready printer, then press any key..."
  528.    WAIT
  529.    SET PRINT ON
  530. ENDIF (LP = Y)
  531.  
  532. ************ Use LF to count line-feeds for formatting
  533. ************ On the screen and printer.
  534. STORE 0 TO LF
  535.  
  536.  
  537. ************ Finally, print the report, listing only
  538. ************ references for whom &CND is true.
  539. ERASE
  540. DO WHILE .NOT. EOF
  541.    IF &CNDè      ? "Author:",AUTHOR
  542.       ? "Title :",TITLE
  543.       ? "Pub.  :",PUB
  544.       ? "Date  :",DATE,"        Pages : ",PAGES
  545.       ?
  546.       ? "Keywords : "+KEYWORDS
  547.       ? "Abstract : "
  548.       STORE LF+7 TO LF
  549.       ****************** Break off long abstract at space
  550.       ****************** Nearest the right margin.
  551.       STORE TRIM(ABSTRACT) TO STRING
  552.       STORE LEN(TRIM(STRING)) TO TLEN
  553.       DO WHILE TLEN > 60
  554.          **************** Find space nearest right margin
  555.          STORE 60 TO SPOT
  556.          DO WHILE $(STRING,SPOT,1)<>" "
  557.             STORE SPOT-1 TO SPOT
  558.          ENDDO (while not " ")
  559.          **************** Print sub-string and break off section.
  560.          ? $(STRING,1,SPOT-1)
  561.          STORE LEN(TRIM(STRING))-SPOT TO TLEN
  562.          STORE $(STRING,SPOT+1,TLEN) TO STRING
  563.          STORE LF+1 TO LF
  564.      ENDDO (while len > 60)
  565.      ? STRING
  566.      ?
  567.      ?
  568.      STORE LF+3 TO LF
  569.      ************* Count line feeds, and start on 
  570.      ************* new page, if necessary.
  571.      IF LF >= 55
  572.         EJECT
  573.         STORE 0 TO LF
  574.      ENDIF (lf > 55) 
  575.  
  576.    ENDIF (cnd)
  577.    SKIP
  578. ENDDO (while not eof)
  579.  
  580. SET PRINT OFF
  581. USE
  582. RETURN
  583.  
  584.  
  585. LIBEDIT prepares for editing, and manages keyword file updates.
  586. 
  587.  
  588. ***************************** LIBEDIT.CMD
  589. ************* Allows user to look up a reference
  590. ************* by primary author name, and change
  591. ************* data.  Automatically updates the
  592. ************* keyword history file.
  593.  
  594. ************* Set up databases and memory variables.
  595. SELE PRIMèUSE LIBRARY INDEX AUTHORS,DATES
  596. SELE SECO
  597. USE KEYWORDS INDEX KEYWORDS
  598. SELE PRIM
  599. STORE "              " TO K1,K2,K3,K4,K5,K6,K7
  600.  
  601. ************** Find out who to edit.
  602. ERASE
  603. ?
  604. ACCEPT " Enter Main Author's last name " TO SEARCH
  605. STORE !(SEARCH) TO SEARCH
  606. ERAS
  607.  
  608. *************** Determine if 0, 1 or many references
  609. *************** By this author, and react accordingly.
  610. FIND &SEARCH
  611.  
  612.  
  613. STORE 0 TO HOWMANY
  614. COUNT WHILE !(AUTHOR) = SEARCH TO HOWMANY
  615.  
  616.  
  617. DO CASE
  618.  
  619.    CASE HOWMANY = 0
  620.         STORE 0 TO RECNO
  621.         ?
  622.         ? " There is no &SEARCH on the database."
  623.         ?
  624.         WAIT
  625.  
  626.    CASE HOWMANY = 1
  627.         FIND &SEARCH
  628.         STORE # TO RECNO
  629.  
  630.    CASE HOWMANY > 1
  631.         FIND &SEARCH
  632.         LIST WHILE LNAME = &SEARCH AUTHOR, TITLE, PUB
  633.         ?
  634.         INPUT " Which one (by number) " TO RECNO
  635.  
  636. ENDCASE
  637.  
  638. *********** Edit appropriate record, if recno > 0
  639. ERASE
  640. IF RECNO > 0
  641.  
  642.    GOTO RECNO
  643.    *************** Peel out individual keywords from
  644.    *************** the long KEYWORDS field in the
  645.    *************** library database.
  646.    STORE 2 TO START
  647.    STORE 1 TO COUNT
  648.    STORE KEYWORDS TO TEMP
  649.    DO WHILE "," $(KEYWORDS)è      STORE STR(COUNT,1) TO SCOUNT
  650.       STORE $(KEYWORDS,START,@(",",KEYWORDS)-2) TO K&SCOUNT
  651.       REPLACE KEYWORDS WITH $(KEYWORDS,@(",",KEYWORDS)+1,50)
  652.       STORE COUNT+1 TO COUNT
  653.    ENDDO (while "," $keywords)
  654.  
  655.    ************* just in case user deletes any or all
  656.    ************* keywords, subtract 1 from the total number
  657.    ************* of references for this keyword from
  658.    ************* The keywords file.
  659.    SELE SECO
  660.    STORE 1 TO X
  661.    STORE "1" TO MAC
  662.    DO WHILE K&MAC <> " "
  663.       FIND &K&MAC
  664.       REPLACE KEYNO WITH KEYNO-1
  665.       STORE X+1 TO X
  666.       STORE STR(X,1) TO MAC
  667.    ENDDO
  668.  
  669.    ****** Now branch to LIBED2 to do the edit.
  670.    ****** (LIBED2 is stolen from the LIBADD command file.)
  671.    SELE PRIM
  672.    DO LIBED2
  673. ENDIF (recno > 0)
  674.  
  675. **************** Before returning to main menu,
  676. **************** Eliminate any keywords for which there 
  677. **************** are no references
  678. ERASE
  679. ? " Updating keyword file.........."
  680. SELE SECO
  681. DELE ALL FOR KEYNO=0
  682. PACK
  683.  
  684. RETURN
  685. 
  686.  
  687. LIBED▓á i≤ aε extensioε oµ LIBED¼á anΣ handle≤ thσ actua∞á screeε ì
  688. display in editing data.  It is mostly a clone of LIBADD.
  689.  
  690. 
  691. **************************************** LIBED2.CMD
  692. **************************** Allow user to edit reference,
  693. **************************** then re-update keywords file.
  694. *************** (This command file was created by "borrowing"
  695. *************** a portin of LIBADD.CMD, and modifying).
  696. ERASE
  697. @  1, 3 SAY "Record No. "+STR(#,3)
  698. @  2, 0 SAY "--------------------------------------------------"
  699. @  2,50 SAY "------------------------------"
  700. @  4, 3 SAY "Author"
  701. @  4,12 GET AUTHOR
  702. @  5, 3 SAY "Title"
  703. @  5,12 GET TITLEè@  6, 3 SAY "Pub."
  704. @  6,12 GET PUB
  705. @  7, 3 SAY "Date"
  706. @  7,12 GET DATE PICT "99/99/99"
  707. @  7,26 SAY "Pages"
  708. @  7,32 GET PAGES
  709. @  9, 3 SAY "Abstract"
  710. @  9,12 GET ABSTRACT
  711. @ 13, 3 SAY "Keyword 1"
  712. @ 13,13 GET K1
  713. @ 14, 3 SAY "Keyword 2"
  714. @ 14,13 GET K2
  715. @ 15, 3 SAY "Keyword 3"
  716. @ 15,13 GET K3
  717. @ 16, 3 SAY "Keyword 4"
  718. @ 16,13 GET K4
  719. @ 17, 3 SAY "Keyword 5"
  720. @ 17,13 GET K5
  721. @ 18, 3 SAY "Keyword 6"
  722. @ 18,13 GET K6
  723. @ 19, 3 SAY "Keyword 7"
  724. @ 19,13 GET K7
  725. @ 21, 0 SAY "--------------------------------------------------"
  726. @ 21,50 SAY "------------------------------"
  727. READ
  728.  
  729.  
  730. ****************** Update Keyword File.
  731. SELECT SECONDARY
  732. STORE " " TO TEMPKEY
  733. STORE 1 TO COUNT
  734. STORE STR(COUNT,1) TO MAC
  735. DO WHILE K&MAC <> " " .AND. COUNT < 8
  736.    STORE !(K&MAC) TO K&MAC
  737.    FIND &K&MAC
  738.    IF # > 0
  739.       REPLACE KEYNO WITH KEYNO+1
  740.    ELSE
  741.       APPEND BLANK
  742.       REPLACE KEYWORD WITH K&MAC
  743.       REPLACE KEYNO WITH 1
  744.    ENDIF (# > 0)
  745.    *** Now, concatentate K&MAC into temporary KEYWORDS string.
  746.    STORE TEMPKEY+TRIM(K&MAC)+", " TO TEMPKEY
  747.    STORE COUNT +1 TO COUNT
  748.    STORE STR(COUNT,1) TO MAC
  749. ENDDO (k&mac<>" ")
  750.  
  751. *********************** Put tempkey into keywords
  752. SELECT PRIMARY
  753. REPLACE KEYWORDS WITH TEMPKEY
  754.  
  755. RETURN
  756. 
  757.