home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol285 / maintain.prg < prev    next >
Encoding:
Text File  |  1986-12-22  |  5.3 KB  |  159 lines

  1. **    Last revision: April 17, 1986 at 18:54
  2. * maintain.prg
  3. * file maintenance menu
  4. * set up loop
  5. STOR .t. TO more
  6. DO WHIL more
  7.  CLEA
  8.  STOR ' ' TO command
  9.  STOR CDOW(DATE())+' '+CMONTH(DATE())+' '+STR(DAY(DATE()),2)+", "+STR(YEAR(DATE()),4) TO mday
  10.  STOR 'MAINTENANCE MENU' TO mode
  11.  SET COLOR TO &revvideo
  12.  @ 2,00
  13.  @ 2,01 SAY mday
  14.  @ 2,31 SAY mode
  15.  SET COLOR TO &stdvideo
  16.  @ 06,22 SAY 'A. Find duplicate records'
  17.  @ 07,22 SAY 'B. Verify and merge new entries'
  18.  @ 08,22 SAY 'C. Verify deleted entries'
  19.  @ 09,22 SAY 'D. Purge deleted entries from file'
  20.  @ 10,22 SAY 'E. Re-index the records into all indexes'
  21.  @ 11,22 SAY 'F. Use browse command'
  22.  @ 12,22 SAY 'G. Return to main menu'
  23.  @ 15,00 SAY line
  24.  @ 17,33 SAY 'SELECT:'
  25.  @ 17,43 GET command PICTURE '!'
  26.  READ
  27.  DO CASE
  28.  CASE command = 'A'
  29.   DO dupcheck
  30.   LOOP
  31.  CASE command = 'B'
  32.   DO verifnew
  33.   LOOP
  34.  CASE command = 'C'
  35.   DO verifdel
  36.   LOOP
  37.  CASE command = 'D'
  38.   STOR 'N' TO comman
  39.   CLEA
  40.   @ 02,05 SAY '*****   WARNING!   *****   WARNING!   *****   WARNING!   ****'
  41.   @ 04,05 SAY 'This will PERMANENTLY remove any deleted records.'
  42.   @ 06,05 SAY 'Type Y to continue, any other key to cancel this operation'
  43.   @ 06,64 GET comman PICTURE '!'
  44.   READ
  45.   IF comman = 'Y'
  46.    CLEA
  47.    TEXT
  48.  
  49. Records which have been marked for deletion are being removed from the file.
  50.  
  51. When that is completed, all records will be reindexed. 
  52.  
  53. We will keep you posted as we go along..........but please be patient.
  54.  
  55.    ENDT
  56.    STOR RECCOUNT() TO before
  57.    @ 08,00 SAY 'The data base contains ' + STR(before,4) + ' files before deletions'
  58.    @ 09,00 SAY ' '
  59.    SET TALK ON
  60.    PACK
  61.    SET TALK OFF
  62.    STOR RECCOUNT() TO after
  63.    @ 19,00 SAY  'The data base contains ' + STR(after,4)+ ' files. ' + STR(before-after,4)+' files were deleted.'
  64.    @ 21,00 SAY '***************************************************************************'
  65.    @ 22,20 SAY 'HIT ANY KEY TO CONTINUE'
  66.    SET CONSOL OFF
  67.    WAIT
  68.    SET CONSOL ON
  69.   ENDI comman = Y
  70.   LOOP
  71.  CASE command = 'E'
  72.   CLEA
  73.   @ 2,00 SAY 'We are going to reindex the file. Please be patient as this may'
  74.   @ 3,00 SAY 'take a while.'
  75.   @ 5,00 SAY '  '
  76.   SET TALK ON
  77.   SET ECHO ON
  78.   INDE ON UPPER(lastname)+UPPER(fname) TO lastname
  79.   SET TALK OFF
  80.   SET ECHO OFF
  81.   LOOP
  82.  CASE command = 'F'
  83.   CLEA
  84.    @ 01,12 SAY '***WARNING***  ***WARNING***  ***WARNING***'
  85.    @ 03,13 SAY 'Changes made will be written to the File'
  86.    @ 04,13 SAY 'Follow instructions at the top of screen'
  87.    STOR '    ' TO stletter
  88.    @ 09,13 SAY 'At what letter or number shall we start browsing......'
  89.    @ 09,67 Get stletter PICTURE '!!!!'
  90.    READ
  91.    STOR TRIM(stletter) TO stletter
  92.    SEEK stletter
  93.    IF .NOT. found()
  94.     GO TOP
  95.    ENDI
  96.    SET HEADING ON
  97.    SET ESCAPE OFF
  98.   IF clipper
  99.    DO brow  WITH "AG"
  100.   ELSE
  101.    BROW fields lastname, fname, dear, send
  102.   ENDIF .NOT. clipper
  103.    SET ESCAPE ON
  104.    SET HEADING OFF
  105.   LOOP
  106.  CASE command = '?'
  107.   CLEA
  108.   @ 1,13 SAY "M A I N T E N A N C E   M E N U   H E L P   S C R E E N"
  109.   @ 3, 6 SAY "Thank you for asking me to help you. At this point you can find"
  110.   @ 4, 0 SAY "duplicate record, verify and merge new entries, etc. Let us go through"
  111.   @ 5, 0 SAY "them one at a time."
  112.   @ 7, 0 SAY "Find duplicate record - I will search by consumer last names. Where"
  113.   @ 8, 0 SAY "more than one complainant has the same last name it will show. However,"
  114.   @ 9, 0 SAY "in some cases we will have entered the same information twice - and "
  115.   @ 10, 0 SAY "this program will help us locate that error."
  116.   @ 12, 0 SAY "Verify and merge new entries - everytime you create a file - I make a"
  117.   @ 13, 0 SAY "mark in it that says 'This is a new file' This part of the program"
  118.   @ 14, 0 SAY "lets you look at all the new entries. If you 'Accept' the entry - then the"
  119.   @ 15, 0 SAY "new mark gets taken out."
  120.   @ 17, 0 SAY "Verify deleted entries - if you have marked a record for deletion - this"
  121.   @ 18, 0 SAY "searches for it - gives you a chance to make sure what records are to be"
  122.   @ 19, 0 SAY "deleted."
  123.   @ 21,15 SAY "Please hit any key to continue.........."
  124.   SET CONSOLE OFF
  125.   WAIT
  126.   SET CONSOLE ON
  127.   CLEA
  128.   @ 07, 0 SAY "Purge deleted entries - this permanently removes from the file all entries"
  129.   @ 08, 0 SAY "marked for deletion and then reindexes the file. Use this carefully and only"
  130.   @ 09, 0 SAY "purge after you have made a backup of the file."
  131.   @ 11, 0 SAY "Reindex - this is necessary if you are going to search for a file using the"
  132.   @ 12, 0 SAY "search by index command."
  133.   @ 14, 0 SAY "Use browse - browse is there for the expert user. It allows you to write"
  134.   @ 15, 0 SAY "directly into the records. If you do not know what you are doing NEVER use"
  135.   @ 16, 0 SAY "browse. It is simulated in Clipper. "
  136.   @ 21,12 SAY "Please press any key to return to the menu........."
  137.   SET CONSOLE OFF
  138.   WAIT
  139.   SET CONSOLE ON
  140.   CLEA
  141.   LOOP
  142.  CASE command = '*'
  143.   IF .NOT. clipper
  144.    CLEA ALL
  145.    SET TALK ON
  146.    ON ERROR SUSPEND
  147.    ON ESCAPE SUSPEND
  148.    CANC
  149.   ENDI
  150.     LOOP
  151.  CASE (command = 'G' .OR. command = 'Q')
  152.   STOR .f. TO more
  153.  ENDC
  154. ENDD while more
  155. STOR .t. TO first
  156. STOR .t. TO more
  157. RETU
  158. 
  159.