home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / clipper / chmult.arj / MULTIUSE.CH < prev    next >
Encoding:
Text File  |  1992-01-04  |  2.2 KB  |  42 lines

  1. #define IS_MULT
  2. #define USEWAIT 10
  3. #define ADDWAIT 10
  4. #define RECWAIT 10
  5. #define FILEWAIT 10
  6. #define rptpoint &user.rptpt
  7. #command USE <dbf> INDEX <ntx,...> => ;
  8.     if netuse(<"dbf">, .f., USEWAIT) ; set index to <ntx>; else; return; endif
  9. #command USE <dbf> => if .not. netuse(<"dbf">, .f., USEWAIT); return; endif
  10. #command APPEND BLANK => if .not. addrec(ADDWAIT); return; endif
  11. #command RE_NTX <dbf> => if .not. netuse(<"dbf">, .t., USEWAIT); return; endif
  12. #command IF MULT LOCK REC => if .not. reclock(RECWAIT); return; endif
  13. #command IF MULT LOCK FILE => if .not. fillock(FILEWAIT); return; endif
  14. #command IF MULT UNLOCK => unlock
  15. #command EXCL OFF => set exclusive off
  16.  
  17. * NOTES: This file, multiuse.ch, goes in the multiuse subdirectory under the prg
  18. *        file directory.  This is the subdirectory where multiuser obj files are
  19. *        stored.
  20. *        ANOTHER file called multiuse.ch goes in the singluse subdirectory.
  21. *        This version has only one line with nothing but an asterisk in col.1.
  22. *        It is the only necessary occupant of the singluse subdirectory.
  23.  
  24. *        rptpoint happens to be a "pointer" dbf that I use to single out certain
  25. *          data records for reporting.  In the multiuser case, I want each user
  26. *          to have his/her own set of pointers.  This is merely illustrative,
  27. *          because I'm not sure where the "&user." part comes from!
  28.  
  29. *        IF MULT: Besides putting #include "director.ch"
  30. *          at the beginning, these are the only changes needed in your prg
  31. *          files.  You salt them in around REPLACEs.
  32. *        EXCL OFF: Oh, yes. Put that in at the beginning of your main prg.
  33. *        RE_NTX: Oh, yes. Put  re_ntx /filename/  before reindexing or rebuiling
  34. *                the index, to (attempt to) get exclusive access.
  35. *                Perhaps you need to put  EXCL OFF  after reindexing, too.
  36.  
  37. *        netuse, addrec, reclock, and fillock are calls to functions in
  38. *        LOCKS.PRG, that comes with Clipper 5 (normally it's in 
  39. *        c:\clipper5\source\sample) _as modified by_ Rick Spence in his Clipper 
  40. *        books. (He puts in the stuff where the user is asked if he wants to
  41. *        wait for the record or file to be freed up, as I recall).
  42.