home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / DATABASE / BLTC17.ZIP / !README2.TXT < prev    next >
Encoding:
Text File  |  1993-08-31  |  2.0 KB  |  53 lines

  1. Read me too (shareware release)
  2.  
  3. --Status value return code with transaction-based routines
  4.  
  5. The transaction-based routines, InsertXB, UpdateXB, ReindexXB, LockXB and
  6. UnlockXB, do not return the completion status. The return value is the
  7. pack index number that failed. The following example assumes that you are
  8. using multiple index files. If you're not, replace AP(x).y with AP.y.
  9.  
  10.    AP[0].Func = INSERTXB;
  11.    pid = BULLET(&AP);
  12.    if (pid == 0) {
  13.       if (AP[0].stat == 0) {
  14.          /* all okay */
  15.       else {                  /* error while adding the data record is       */
  16.          rstat = AP[1].stat;  /* returned in AP(1).stat if and only if pid=0 */
  17.          DoErrorWithDataRecord(stat);
  18.          }
  19.       }
  20.    else {
  21.       rstat = AP[pid].stat;
  22.       DoErrorWithIndexFile(pid, stat);
  23.       }
  24.    }
  25.  
  26. For complete information consult the above named routines in CZ. Note that
  27. ReindexXB does not operate on a data file separately so if its return
  28. code=0 (pid=0) then all operations succeeded. However, with the LockXB
  29. routines, if pid > number_of_packs then the lock on the data file failed.
  30. The following example assumes that a single index file and data file are
  31. to be locked.
  32.  
  33.    packs = 1;                 /* 1 pack (single index file per data file) */
  34.    AP.Func = LOCKXB;
  35.    pid = BULLET(&AP);
  36.    if (pid == 0) {
  37.       /* all okay */
  38.    else
  39.       if (pid <= packs) {   /* error while locking index file and error code */
  40.          rstat = AP.stat;           /* in AP.stat */
  41.          DoErrorWithIndexFile(stat);
  42.          }
  43.       else {                /* error while locking data file and error code */
  44.          stat = AP.stat;    /* also in AP.stat */
  45.          DoErrorWithDataFile(stat);
  46.       }
  47.    }
  48.  
  49. --In case a C example does not compile, do not assume that the example is 100%
  50. correct C and that something must be wrong. I'm no C programmer--not by a mile.
  51. If something doesn't compile make the needed corrections. Let me know about my
  52. mistakes and I will be ever so grateful. -chh
  53.