home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / progmisc / bltq13a.zip / !README2.TXT < prev    next >
Text File  |  1993-04-22  |  2KB  |  46 lines

  1. Read me too (shareware release)
  2. BULLET v1.03, 22-Apr-93 (BLTQ12)
  3.  
  4. --Status value return code with transaction-based routines
  5.  
  6. The transaction-based routines, InsertXB, UpdateXB, ReindexXB, LockXB and
  7. UnlockXB, do not return the completion status. The return value is the
  8. pack index number that failed. The following example assumes that you are
  9. using multiple index files. If you're not, replace AP(x).y with AP.y.
  10.  
  11.    AP(1).Func = InsertXB
  12.    pid = BULLET(AP(1))
  13.    IF pid = 0 THEN
  14.       IF AP(1).stat = 0 THEN
  15.          'all okay
  16.       ELSE                      'error while adding the data record is returned
  17.          stat = AP(1).stat      'in AP(1).stat if and only if pid=0
  18.          DoErrorWithDataRecord stat
  19.       ENDIF
  20.    ELSE
  21.       stat = AP(pid).stat
  22.       DoErrorWithIndexFile pid, stat
  23.    ENDIF
  24.  
  25. For complete information consult the above named routines in CZ. Note that
  26. ReindexXB does not operate on a data file separately so if its return
  27. code=0 (pid=0) then all operations succeeded. However, with the LockXB
  28. routines, if pid > number_of_packs then the lock on the data file failed.
  29. The following example assumes that a single index file and data file are
  30. to be locked.
  31.  
  32.    packs = 1                    '1 pack (single index file per data file)
  33.    AP.Func = LockXB
  34.    pid = BULLET(AP)
  35.    IF pid = 0 THEN
  36.       'all okay
  37.    ELSEIF pid <= packs          'error while locking index file and error code
  38.       stat = AP.stat            'in AP.stat
  39.       DoErrorWithIndexFile stat
  40.    ELSE                         'error while locking data file and error code
  41.       stat = AP.stat            'also in AP.stat
  42.       DoErrorWithDataFile stat
  43.    ENDIF
  44.  
  45.  
  46.