home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol110 / add.acg < prev    next >
Encoding:
Text File  |  1984-04-29  |  2.3 KB  |  89 lines

  1. * add.prg 03/15/83 
  2. * this program will add records to the current files 
  3. * the records will be marked as new 
  4. * for later verification and merging 
  5.  
  6. * eliminate use of indexes for speed
  7. SET INDEX to
  8.  
  9. * set up screen for data entry 
  10. SET FORMAT TO mod-rec 
  11.  
  12. *loop until finished adding records 
  13. STORE t TO more 
  14. DO WHILE more 
  15.   
  16.   * get a new set of memory variables for data entry 
  17.   RESTORE FROM ADD 
  18.   STORE 'Add new records' TO mode 
  19.   STORE 'Enter as many records as you want.' TO prompt1 
  20.   STORE 'When done, enter blank for Last name and Company' TO prompt2
  21.   STORE 'Or Control Q to end session' TO prompt3 
  22.   STORE t TO more 
  23.   
  24.   * let user enter data 
  25.   READ 
  26.   
  27.   * if a last name or company was entered 
  28.   * add a new record with the entered data 
  29.   IF mlastname <> ' ' .OR. mcompany1 <> ' ' 
  30.     
  31.     * validate entries 
  32.     DO valid.acg 
  33.     
  34.     * add a new record to the files 
  35.     APPEND BLANK 
  36.     
  37.     * fill in the new data 
  38.     REPLACE lastname WITH mlastname, fname WITH mfname 
  39.     REPLACE spouse WITH mspouse, mr WITH mmr 
  40.     REPLACE title WITH mtitle, company1 WITH mcompany1 
  41.     REPLACE company2 WITH mcompany2, caddress WITH mcaddress 
  42.     REPLACE suite WITH msuite, ccity WITH mccity
  43.     REPLACE cst WITH mcst, czip WITH mczip 
  44.     REPLACE address WITH maddress, apt WITH mapt
  45.     REPLACE city WITH mcity, st WITH mst
  46.     REPLACE zip WITH mzip, ophone WITH mophone
  47.     REPLACE phone WITH mphone, dear WITH mdear 
  48.     REPLACE send WITH msend, misc WITH mmisc 
  49.     REPLACE cs1 WITH mcs1, cs2 WITH mcs2 
  50.     REPLACE cs3 WITH mcs3, cs4 WITH mcs4 
  51.     REPLACE cs5 WITH mcs5, cs6 WITH mcs6 
  52.     REPLACE UPDATE WITH mupdate 
  53.     
  54.     * mark the record as new
  55.     REPLACE new WITH t
  56.     
  57.     
  58.   ELSE
  59.     * there are no more records to add
  60.     * set up the loop to finish
  61.     
  62.     * restore original index and reindex
  63.     * since it takes time, first tell them
  64.     ERASE
  65.     ?
  66.     ?
  67.     ?
  68.     ? 'Files are now being reindexed. ' 
  69.     ? 'Please be patient as this will take a few minutes.' 
  70.     ?
  71.     
  72.     INDEX ON !(lastname) TO lastname
  73.     INDEX ON !(company1) TO company
  74.     INDEX ON zip TO zip
  75.     SET INDEX to lastname, company, zip
  76.     STORE f TO more
  77.  
  78.   ENDIF mlastname <> ' ' .OR. mcompany1 <> ' '  
  79.   
  80.   *loop back again
  81. ENDDO WHILE more  
  82.  
  83. *release local variables
  84. RELEASE ALL
  85.  
  86. * restore original variables
  87. STORE '?' TO command
  88.  
  89.