home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR36 / BTV200.ZIP / BTVX.INT < prev    next >
Text File  |  1993-12-18  |  4KB  |  125 lines

  1. {*
  2. *=========================================================================
  3. *  BTVX.PAS  Version 2.00
  4. *
  5. *  BTRIEVE object oriented interface for Turbo Pascal 6.0, 7.0
  6. *
  7. *  Copyright (c) 1993 by Richard W. Hansen, all rights reserved.
  8. *
  9. *
  10. *  Requires Turbo Pascal version 6.0, 7.0
  11. *
  12. *
  13. *  Registration and payment of a license fee is required for any use, whether
  14. *  in whole or part, of this source code.
  15. *=========================================================================
  16. *
  17. *}
  18.  
  19. {****************************************************************************}
  20. {*   REVISION HISTORY                                                       *}
  21. {*                                                                          *}
  22. {*  Date     Who  What                                                      *}
  23. {* ======================================================================== *}
  24. {* 10/02/93  RWH  Initial release coded and tested.                         *}
  25. {****************************************************************************}
  26.  
  27. UNIT BtvX;
  28. {$F-}
  29. {$V-}
  30. {$X+}
  31. {$A-}
  32.  
  33.  
  34. INTERFACE
  35.  
  36. USES
  37.   Objects,    { Turbo Vision unit for TObject & TCollection }
  38.   BtvConst,
  39.   Btv,
  40.  
  41.   {$IFDEF MSDOS}
  42.   BTRVDOS;
  43.   {$ENDIF}
  44.  
  45.   {$IFDEF DPMI}
  46.   BTRVDPMI;
  47.   {$ENDIF}
  48.  
  49.   {$IFDEF WINDOWS}
  50.   BTRVWIN;
  51.   {$ENDIF}
  52.  
  53.  
  54. TYPE
  55.   { object type to hold info on filtering conditions }
  56.   PFilterCondition = ^TFilterCondition;
  57.   TFilterCondition = Object(TOBject)
  58.     fType   : Byte;
  59.     Size    : Word;
  60.     Offset  : Word;
  61.     Compare : Byte;
  62.     Logic   : Byte;
  63.     Data    : Pointer;
  64.  
  65.     Destructor Done;  virtual;
  66.   end;
  67.  
  68.  
  69.   { object type to hold info on fields to be extracted }
  70.   PFieldExtractor  = ^TFieldExtractor;
  71.   TFieldExtractor  = Object(TOBject)
  72.     Size    : Word;
  73.     Offset  : Word;
  74.   end;
  75.  
  76.  
  77.   { the extended Btrieve type descended from normal Btrieve object type }
  78.   PXBtrieveFile = ^XBtrieveFile;
  79.   XBtrieveFile  = Object(BtrieveFile)
  80.     Filters     : PCollection;
  81.     Extractors  : PCollection;
  82.     MaxSkip     : Word;
  83.     MaxExtract  : Word;
  84.     XData       : PBytes;
  85.     XDataSize   : Word;
  86.     XOffset     : Word;
  87.     XCount      : Word;
  88.     XRecCount   : Word;       { number of records read in XGet }
  89.  
  90.     Constructor Init(FilePath   : PathStr;
  91.                      ErrorObject: PErrorHandler;
  92.                      DataBuf    : Pointer;
  93.                      DataBufSize: Word);
  94.     Destructor Done;                                  Virtual;
  95.     Procedure AddFieldToExtract(FieldSize   : Word;
  96.                                 FieldOffset : Word);
  97.       {- add a field to extract from a record by the XGet}
  98.     Procedure AddFilterCondition(    FieldType      : Byte;
  99.                                      FieldSize      : Word;
  100.                                      FieldOffset    : Word;
  101.                                      ComparisonType : Byte;
  102.                                      LogicType      : Byte;
  103.                                  var ComparisonValue);
  104.       {- add a filtering condition used by the XGet }
  105.     Function  ExtractNextRec(var DataBuf;
  106.                                  DataOnly : Boolean): Boolean;
  107.       {- after XGet, extracts each record from the buffer }
  108.     Procedure SetExtractCount(ExtractCount : Word);
  109.       {- set maximum number of records to get from the file }
  110.     Procedure SetRejectCount(RejectCount : Word);
  111.       {- set the maximum number of records to skip in search }
  112.     Procedure XDone;
  113.       {- cleanup and free memory after XGet }
  114.     Procedure XInit(XDataBuf     : Pointer;
  115.                     XDataBufSize : Word);
  116.       {- setup before an XGet or XInsert }
  117.     Procedure XGet(Op : Word);
  118.       {- execute an extended Get or Step }
  119.     Function  XInsert: Word;
  120.       {- execute an extended Insert }
  121.     Procedure XReset;
  122.       {- reset extractor and filter info between XGets }
  123.   end;
  124.  
  125.