home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_09 / 2n09061c < prev    next >
Text File  |  1991-08-01  |  905b  |  41 lines

  1. rBEGIN
  2. OPEN Master;
  3. OPEN Update;
  4.  
  5. WHILE FETCH Update.*
  6. DO BEGIN
  7.    CASE UpdateList.action
  8.     "A": BEGIN
  9.          WHILE (Master.key < Update.key)
  10.          DO FETCH Master.*;
  11.          INSERT Update.* INTO Master;
  12.          END;
  13.  
  14.     "B": BEGIN /* Position to old record in master file */
  15.          WHILE (Master.key < Update.key)
  16.          DO FETCH Master.*;
  17.          END;
  18.    
  19.     "C": BEGIN /* B ought to put you on the right record */
  20.          IF (Master.key = Update.key)
  21.          THEN BEGIN
  22.               DELETE Master.*;
  23.               INSERT Update.* INTO Master;
  24.               FETCH Master;
  25.               END;
  26.           END;
  27.  
  28.     "D": BEGIN
  29.          WHILE Master.key < Update.key)
  30.          DO FETCH Master.*;
  31.          IF (Master.key = Update.key)
  32.          THEN DELETE Master.*;
  33.          END;
  34.     END;
  35.  
  36. CLOSE Master;
  37. SORT Master ON Master.key;
  38. CLOSE Update;
  39. END;
  40.  
  41.