home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / PASCAL / TBTREE16.ZIP / QUICKREF.DOC < prev    next >
Text File  |  1989-07-15  |  33KB  |  1,189 lines

  1.  
  2.     TBTREE16             Copyright (c)  1988,1989   Dean H. Farwell II
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.                                    TBTREE16
  19.  
  20.                           ( Turbo BTree version 1.5 )
  21.  
  22.                              Quick Reference Guide
  23.  
  24.                 Copyright (c)  1988,1989    Dean H. Farwell II
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.                                         1
  65.  
  66.  
  67.  
  68.     TBTREE16             Copyright (c)  1988,1989   Dean H. Farwell II
  69.  
  70.  
  71.  This reference guide is intended to simplify use of TBTREE16.  It provides a
  72.  listing of some of the procedures, functions, data types and constants
  73.  available to the user.  It is not all inclusive but is limited to those which
  74.  are normally required by the user to use TBTREE16.  I have specifically
  75.  excluded those items which I use internally between units but are of little
  76.  value to you or those which could be used in other applications but are not
  77.  necessary to use with TBTREE.  You can still use them by referring to the
  78.  particular unit in which they reside.  However, it is imperative that you
  79.  understand what the internal routines are doing before using them.
  80.  
  81.  This Quick Reference Guide was developed to simplify the learning process for
  82.  the user and to give guidance concerning which routines the user should
  83.  reasonably be involved with.
  84.  
  85.  This guide is not intended to fully document the included items, especially
  86.  the procedures and functions.  The source code for the units contains much
  87.  more in-depth documentation. This guide is only meant to provide a place to
  88.  turn when a quick refresher is required.
  89.  
  90.  
  91.                                    Constants
  92.                                    ---------
  93.  
  94.  FNSIZE
  95.       - FNSIZE = 80;
  96.       - Maximum number of characters in a file name (including drive, path,
  97.         file name and extension)
  98.       - FILEDECS unit
  99.  
  100.  MAXDATASIZE
  101.       - MAXDATASIZE = 65520;
  102.       - Maximum size for a data record (logical record)
  103.       - LOGICAL unit
  104.  
  105.  MAXSTRINGLENGTH = 255;
  106.       - MAXSTRINGLENGTH = 255;
  107.       - Maximum characters in a string
  108.       - STRINGS unit
  109.  
  110.  MAXVALSIZE
  111.       - MAXVALSIZE = 245;
  112.       - Maximum size of an index entry
  113.       - BTREE unit
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.                                         2
  131.  
  132.  
  133.  
  134.     TBTREE16             Copyright (c)  1988,1989   Dean H. Farwell II
  135.  
  136.  
  137.                                      Types
  138.                                      -----
  139.  
  140.  BufferSizeType
  141.       - BufferSizeType = 0 .. MAXWORD;
  142.       - Used for number of pages in buffer
  143.       - PAGE unit
  144.  
  145.  ByteArray
  146.       - ByteArray = Array [ByteArrayRange] of Byte;
  147.       - Used to store 1 to 255 bytes of data.  Routines in ByteData unit treat
  148.         it somewhat like a string in that first byte contains number of bytes
  149.         of data.
  150.       - BYTEDATA unit
  151.  
  152.  ByteArrayRange
  153.       - ByteArrayRange = 0 .. MAXBYTE;
  154.       - Used as index type for the ByteArray type
  155.       - BYTEDATA unit
  156.  
  157.  DataSizeRange
  158.       - DataSizeRange = 0 .. MAXDATASIZE;
  159.       - Range for size of a field and a logical record
  160.       - LOGICAL unit
  161.  
  162.  FileTypes
  163.       - FileTypes = (INDEX,DATA,VLRDATA);
  164.       - File types created and used as part of TBTREE16 which are of interest
  165.         to the user
  166.       - FILEDECS unit
  167.  
  168.  FnString
  169.       - FnString  = String[FNSIZE];
  170.       - Used for file names (including drive, full path, file name and
  171.         extensions)
  172.       - FILEDECS unit
  173.  
  174.  IOErrorRec
  175.       - IOErrorRec = record
  176.             routineName : RoutineNameString;
  177.             tBTreeIOResult : Word;
  178.             end;
  179.       - Used to hold information when an I/O error occurs
  180.       - ERROR unit
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.                                         3
  197.  
  198.  
  199.  
  200.     TBTREE16             Copyright (c)  1988,1989   Dean H. Farwell II
  201.  
  202.  
  203.  LrList
  204.       - LrList = record
  205.             fName    : FnString;
  206.             currPage : PrNumber;
  207.             current  : LrNumber;
  208.             count    : LrNumber;
  209.             case Boolean of
  210.                 TRUE  : (lrArray  : LogicalRecordsArray);
  211.                 FALSE : (page : SinglePage);
  212.             end;
  213.       - Type used for logical record lists.  Never manipulate any of the
  214.         fields directly.  Only declare a variable of this type and use
  215.         it as a parameter for the various routines supplied
  216.       - LRECLIST unit
  217.  
  218.  LrNumber
  219.       - LrNumber = RecordNumber;
  220.       - Logical record number within a file
  221.       - FILEDECS unit
  222.  
  223.  OpenFileRange
  224.       - OpenFileRange = Byte;
  225.       - Used as type for number of files that can be open at one time
  226.       - FILEBUFF unit
  227.  
  228.  RoutineNameString
  229.       - RoutineNameString = String[50];
  230.       - Used as type for routine name where error occurred
  231.       - ERROR unit
  232.  
  233.  PrNumber
  234.       - PrNumber = RecordNumber;
  235.       - Physical record number within a file
  236.       - FILEDECS unit
  237.  
  238.  RecordNumber
  239.       - RecordNumber = 0 .. MAXLONGINT;
  240.       - Generic Record number (logical or physical).
  241.       - FILEDECS unit
  242.  
  243.  SortFieldList
  244.       - SortFieldList = ^SortField;
  245.       - Used to form a linked list containing info about sort fields
  246.       - SORT unit
  247.  
  248.  SortFieldPosition
  249.       - SortFieldPosition = DataSizeRange;
  250.       - Position of sort field (in bytes) within the data record
  251.       - SORT unit
  252.  
  253.  StringCondition
  254.       - StringCondition = (ST,    (* String Starts With Substring *)
  255.                            CO,    (* String Contains Substring *)
  256.                            EN);   (* String Ends With Substring *)
  257.       - Used to specify partial string match criteria
  258.       - NUMBERS unit
  259.  
  260.  
  261.  
  262.                                         4
  263.  
  264.  
  265.  
  266.     TBTREE16             Copyright (c)  1988,1989   Dean H. Farwell II
  267.  
  268.  
  269.  StringLengthRange
  270.       - StringLengthRange = 0 .. MAXSTRINGLENGTH;
  271.       - Used as range for number of characters in a string
  272.       - STRINGS unit
  273.  
  274.  UserDataArray
  275.       - UserDataArray  = Array [0 .. 255] of Byte;
  276.       - Used to store user data in parameter records
  277.       - FILEDECS unit
  278.  
  279.  ValueType
  280.       - ValueType = (INVALIDVALUE,
  281.                      BYTEVALUE,
  282.                      SHORTINTVALUE,
  283.                      INTEGERVALUE,
  284.                      LONGINTVALUE,
  285.                      WORDVALUE,
  286.                      STRINGVALUE,
  287.                      REALVALUE,
  288.                      SINGLEVALUE,
  289.                      DOUBLEVALUE,
  290.                      EXTENDEDVALUE,
  291.                      COMPVALUE,
  292.                      BYTEARRAY);
  293.       - Data types supported by TBTREE16 indexes
  294.       - NUMBERS unit
  295.  
  296.  VersionString
  297.       - VersionString = String[6];
  298.       - Used to store version information in the parameter records for the
  299.         different file types.
  300.       - FILEDECS unit
  301.  
  302.  VSizeType = 1 .. MAXVALSIZE;
  303.       - Size range for index entries
  304.       - BTREE unit
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.                                         5
  329.  
  330.  
  331.  
  332.     TBTREE16             Copyright (c)  1988,1989   Dean H. Farwell II
  333.  
  334.  
  335.                                   Procedures
  336.                                   ----------
  337.  
  338.  AddFieldToSortList
  339.       - procedure AddFieldToSortList(var sPtr : SortFieldList;
  340.                                      pos : SortFieldPosition;
  341.                                      vType : ValueType);
  342.       - Used to add one sort field to a sort field list
  343.       - SORT unit
  344.  
  345.  AddToLrList
  346.       - procedure AddToLrList(lrNum : LrNumber;
  347.                               var lrLst : LrList);
  348.       - Add a logical record number to a logical record list (not normally
  349.         needed except internally)
  350.       - LRECLIST unit
  351.  
  352.  AppendTextFile
  353.       - procedure AppendTextFile(fName : FnString;
  354.                                  var fId : Text);
  355.       - Checks open file buffer to see if file is open.  If not it opens
  356.         file and adds it to the buffer.  In either case it returns the file
  357.         id.  It opens the file for appending.
  358.       - FILEBUFF unit
  359.  
  360.  CloseAllFiles
  361.       - procedure CloseAllFiles;
  362.       - Close all files which are open and in the open file buffer
  363.       - FILEBUFF unit
  364.  
  365.  CloseFile
  366.       - procedure CloseFile(fName : FnString);
  367.       - Close a file and delete its entry from the open files buffer
  368.       - FILEBUFF unit
  369.  
  370.  ConcatenateThreeValues
  371.       - procedure ConcatenateThreeValues(var val1;
  372.                                          vType1 : ValueType;
  373.                                          var val2;
  374.                                          vType2 : ValueType;
  375.                                          var val3;
  376.                                          vType3 : ValueType;
  377.                                          var resultArray);
  378.       - Will take three values and will create a new byte array which is a
  379.         concatenation of the three input values.
  380.       - BYTEDATA unit
  381.  
  382.  ConcatenateTwoValues
  383.       - procedure ConcatenateTwoValues(var val1;
  384.                                        vType1 : ValueType;
  385.                                        var val2;
  386.                                        vType2 : ValueType;
  387.                                        var resultArray);
  388.       - Will take two values and will create a new byte array which is a
  389.         concatenation of the two input values.
  390.       - BYTEDATA unit
  391.  
  392.  
  393.  
  394.                                         6
  395.  
  396.  
  397.  
  398.     TBTREE16             Copyright (c)  1988,1989   Dean H. Farwell II
  399.  
  400.  
  401.  ConvertStringToByteArray
  402.       - procedure ConvertStringToByteArray(str : String;
  403.                                            maxLength : StringLengthRange;
  404.                                            var resultArray);
  405.       - Takes a string as input and creates a byte array.
  406.       - BYTEDATA unit
  407.  
  408.  CopyLrList
  409.       - procedure CopyLrList(sourceLrLst : lrList;
  410.                              var destLrLst : LrList);
  411.       - Create a new logical record list which is a copy of the given list
  412.       - LRECLIST unit
  413.  
  414.  CreateDataFile
  415.       - procedure CreateDataFile(dFName : FnString;
  416.                                  lrSize : DataSizeRange);
  417.       - Used to create a data file
  418.       - LOGICAL unit
  419.  
  420.  CreateIndexFile
  421.       - procedure CreateIndexFile(iFName : FnString;
  422.                                   valSize : VSizeType;
  423.                                   valType : ValueType);
  424.       - Used to create an index file
  425.       - BTREE unit
  426.  
  427.  CreateLrList
  428.       - procedure CreateLrList(var lrLst : LrList);
  429.       - Create a logical record list
  430.       - LRECLIST unit
  431.  
  432.  DeleteDataFile
  433.       - procedure DeleteDataFile(dFName : FnString);
  434.       - Used to delete a data file
  435.       - LOGICAL unit
  436.  
  437.  DeleteFromLrList
  438.       - procedure DeleteFromLrList(var lrLst : LrList);
  439.       - Delete one entry from a logical record list
  440.       - LRECLIST unit
  441.  
  442.  DeleteIndexFile
  443.       - procedure DeleteIndexFile(iFName : FnString);
  444.       - Used to delete an index file
  445.       - BTREE unit
  446.  
  447.  DeleteDataRecord
  448.       - procedure DeleteDataRecord(dFName : FnString;
  449.                                    lrNum : LrNumber);
  450.       - Delete the given logical record from the DATA file
  451.       - LOGICAL unit
  452.  
  453.  DeleteValueFromBTree
  454.       - procedure DeleteValueFromBTree(iFName : FnString;
  455.                                        lrNum : LrNumber;
  456.                                        var paramValue);
  457.       - Delete a value and associated logical record number from index
  458.       - BTREE unit
  459.  
  460.                                         7
  461.  
  462.  
  463.  
  464.     TBTREE16             Copyright (c)  1988,1989   Dean H. Farwell II
  465.  
  466.  
  467.  
  468.  
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.                                         8
  527.  
  528.  
  529.  
  530.     TBTREE16             Copyright (c)  1988,1989   Dean H. Farwell II
  531.  
  532.  
  533.  DestroyLrList
  534.       - procedure DestroyLrList(var lrLst : LrList);
  535.       - Destroys a logical record list and performs necessary cleanup
  536.       - LRECLIST unit
  537.  
  538.  DestroySortList
  539.       - procedure DestroySortList(var sPtr : SortFieldList);
  540.       - Deletes all entries from a sort field list returning the heap
  541.         space
  542.       - SORT unit
  543.  
  544.  Difference
  545.       - procedure Difference(lrLst1 : LrList;
  546.                              lrLst2 : LrList;
  547.                              var lrLst3 : LrList);
  548.       - Creates list containing logical record numbers in list one
  549.         but not in list two
  550.       - SETOPS unit
  551.  
  552.  FastMover
  553.       - procedure FastMover(var source;
  554.                             var dest;
  555.                             numToMove : word);
  556.       - Replaces the Turbo Pascal Move routine
  557.       - FASTMOVE unit
  558.  
  559.  FetchFileVersion
  560.       - procedure FetchFileVersion(fName : FnString;
  561.                                    var verString : VersionString);
  562.       - Returns the version of TBTREE used to create the file
  563.       - FILES unit
  564.  
  565.  FetchUserDataArray
  566.       - procedure FetchUserDataArray(fName : FnString;
  567.                                      var userData : UserDataArray);
  568.       - Fetch and return user data array from the given INDEX or DATA file
  569.       - FILES unit
  570.  
  571.  FindLrNumInBTree
  572.       - procedure FindLrNumInBTree(iFName : FnString;
  573.                                    lrNum : LrNumber;
  574.                                    var paramValue;
  575.                                    var found : Boolean);
  576.       - Find logical record number in index and return associated entry if
  577.         found
  578.       - BTREE unit
  579.  
  580.  GetALogicalRecord
  581.       - procedure GetALogicalRecord(fName : FnString;
  582.                                     lrNum : LrNumber;
  583.                                     var destination);
  584.       - Get the specified logical record and place it in destination
  585.       - LOGICAL unit
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.                                         9
  593.  
  594.  
  595.  
  596.     TBTREE16             Copyright (c)  1988,1989   Dean H. Farwell II
  597.  
  598.  
  599.  GetRangeFromBTree
  600.       - procedure GetRangeFromBTree(iFName : FnString;
  601.                                     var paramValue1;
  602.                                     cond1 : Condition;
  603.                                     var paramValue2;
  604.                                     cond2 : Condition;
  605.                                     var lrLst : LrList);
  606.       - Create a list which contains all logical record numbers with
  607.         values which meet both conditions (fall within the given range)
  608.       - BTREE unit
  609.  
  610.  GetSubstringAtPositionFromBTree
  611.       - procedure GetSubstringFromBTree(iFName : FnString;
  612.                                         var paramValue;
  613.                                         position : StringLengthRange;
  614.                                         var lrLst : LrList);
  615.       - Create a list which contains all logical record numbers with
  616.         values which meet the given string condition by having a partial string
  617.         match at the exact location within the target string
  618.       - BTREE unit
  619.  
  620.  GetSubstringFromBTree
  621.       - procedure GetSubstringFromBTree(iFName : FnString;
  622.                                         var paramValue;
  623.                                         cond : StringCondition;
  624.                                         var lrLst : LrList);
  625.       - Create a list which contains all logical record numbers with
  626.         values which meet the given string condition
  627.       - BTREE unit
  628.  
  629.  GetValidLogicalRecords
  630.       - procedure GetValidLogicalRecords(fName : FnString;
  631.                                          var lrLst : LrList);
  632.       - Returns a list of all logical records for a given file.  Allows
  633.         retrievals without use of an index.
  634.       - LOGICAL unit
  635.  
  636.  GetValuesFromBTree
  637.       - procedure GetValuesFromBTree(iFName : FnString;
  638.                                      var paramValue;
  639.                                      cond : Condition;
  640.                                      var lrLst : LrList);
  641.       - Create list which contains all logical record numbers which
  642.         meet the given condition.
  643.       - BTREE unit
  644.  
  645.  InsertValueInBTree
  646.       - procedure InsertValueInBTree(iFName : FnString;
  647.                                      lrNum : LRNumber;
  648.                                      var paramValue);
  649.       - Insert a value and associated logical record number in an index
  650.       - BTREE unit
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.                                         10
  659.  
  660.  
  661.  
  662.     TBTREE16             Copyright (c)  1988,1989   Dean H. Farwell II
  663.  
  664.  
  665.  Intersection
  666.       - procedure Intersection(lrLst1 : LrList;
  667.                                lrLst2 : LrList;
  668.                                var lrLst3 : LrList);
  669.       - Creates list containing logical record numbers in both lists
  670.       - SETOPS unit
  671.  
  672.  OpenTextFile
  673.       - procedure OpenTextFile(fName : FnString;
  674.                                var fId : Text);
  675.       - Checks open file buffer to see if file is open.  If not it
  676.         opens file and adds it to the buffer.  In either case it returns
  677.         the file id
  678.       - FILEBUFF unit
  679.  
  680.  OpenUntypedFile
  681.       - procedure OpenUntypedFile(fName : FnString;
  682.                                   var fId : File;
  683.                                   recSize : Word);
  684.       - Checks open file buffer to see if file is open.  If not it
  685.         opens file and adds it to the buffer.  In either case it returns
  686.         the file id
  687.       - FILEBUFF unit
  688.  
  689.  PrintBufferStats
  690.       - procedure PrintBufferStats;
  691.       - Prints buffer usage statistics to the printer
  692.       - PAGE unit
  693.  
  694.  PrintPageBuffer
  695.       - procedure PrintPageBuffer;
  696.       - Prints entire page buffer to printer
  697.       - PAGE unit
  698.  
  699.  ReleaseAllPages
  700.       - procedure ReleaseAllPages(fName : FnString);
  701.       - Releases all pages for a given file.  Frees up buffer space.
  702.         Does not write them to disk automatically.  VERY DANGEROUS.  Do
  703.         not use unless you fully understand what the routine does!
  704.       - PAGE unit
  705.  
  706.  ReleasePage
  707.       - procedure ReleasePage(fName : FnString;
  708.                               prNum : PrNumber);
  709.       - Releases given page for a given file.  Frees up buffer space.
  710.         Does not write it to disk automatically.  VERY DANGEROUS.  Do
  711.         not use unless you fully understand what the routine does!
  712.       - PAGE unit
  713.  
  714.  RewriteTextFile
  715.       - procedure RewriteTextFile(fName : FnString;
  716.                                   var fId : Text);
  717.       - Rewrites a text file and returns the file id.  Adds file to
  718.         files open buffer
  719.       - FILEBUFF unit
  720.  
  721.  
  722.  
  723.  
  724.                                         11
  725.  
  726.  
  727.  
  728.     TBTREE16             Copyright (c)  1988,1989   Dean H. Farwell II
  729.  
  730.  
  731.  RewriteUntypedFile
  732.       - procedure RewriteUntypedFile(fName : FnString;
  733.                                      var fId: File;
  734.                                      recSize : Word);
  735.       - Rewrites an untyped file and returns the file id.  Adds file to
  736.         files open buffer
  737.       - FILEBUFF unit
  738.  
  739.  SaveUserDataArray
  740.       - procedure SaveUserDataArray(fName : FnString;
  741.                                     userData : UserDataArray);
  742.       - This routine will store the user data array into the given DATA or
  743.         INDEX file.
  744.       - FILES unit
  745.  
  746.  SetImmediateDiskWrite
  747.       - procedure SetImmediateDiskWrite(x : Boolean);
  748.       - Used to set whether dirty pages are immediately written to
  749.         disk.  Setting this to TRUE will degrade performance.
  750.       - PAGE unit
  751.  
  752.  SetMaxBufferPages
  753.       - procedure SetMaxBufferPages(n : BufferSizeType);
  754.       - Used to set the maximum buffer pages to use.  Can be done dynamically
  755.         (at any time) even if more pages than the new maximum are in use
  756.       - PAGE unit
  757.  
  758.  SetMaxOpenFiles
  759.       - procedure SetMaxOpenFiles(n : OpenFileRange);
  760.       - Sets maximum number of files to be open at one time (open in
  761.         the open file buffer)
  762.       - FILEBUFF unit
  763.  
  764.  SortList
  765.       - procedure SortList(var lrLst : LrList;
  766.                            fName : FnString;
  767.                            sPtr : SortFieldList;
  768.                            var success : Boolean);
  769.       - Sorts a logical record list in ascending order using the sort field
  770.         list
  771.       - SORT unit
  772.  
  773.  StoreALogicalRecord
  774.       - procedure StoreALogicalRecord(fName : FnString;
  775.                                       lrNum : LrNumber;
  776.                                       var source);
  777.       - Stores a logical record in the given data file.  Used when the
  778.         associated logical record number is known
  779.       - LOGICAL unit
  780.  
  781.  Union
  782.       - procedure Union(lrLst1 : LrList;
  783.                         lrLst2 : LrList;
  784.                         var lrLst3 : LrList);
  785.       - Creates list containing logical record numbers in either list
  786.       - SETOPS unit
  787.  
  788.  
  789.  
  790.                                         12
  791.  
  792.  
  793.  
  794.     TBTREE16             Copyright (c)  1988,1989   Dean H. Farwell II
  795.  
  796.  
  797.  UserIOError
  798.       - procedure UserIOError(ioErrRec : IOErrorRec);
  799.       - Called when I/O error occurs with TBTREE16 routines
  800.       - ERROR unit
  801.  
  802.  UsingCursorMakeCursorInvalid
  803.       - procedure UsingCursorMakeCursorInvalid(iFName : FnString);
  804.       - Makes cursor invalid.  Never required.  Only alleviates overhead of
  805.         keeping track of cursor when inserts and deletes are performed on the
  806.         index.  Will slightly speed up the inserts and deletes.
  807.       - BTREE unit
  808.  
  809.  VLRCreateDataFile
  810.       - procedure VLRCreateDataFile(dFName : FnString);
  811.       - creates a variable length record data file
  812.       - VLOGICAL unit
  813.  
  814.  VLRDeleteDataFile
  815.       - procedure VLRDeleteDataFile(dFName : FnString);
  816.       - Deletes a variable length record data file.
  817.       - VLOGICAL unit
  818.  
  819.  VLRDeleteDataRecord
  820.       - procedure VLRDeleteDataRecord(dFName : FnString;
  821.                                       lrNum : lrNumber);
  822.       - Delete the given logical record from the VRLDATA file
  823.       - VLOGICAL unit
  824.  
  825.  VLRGetALogicalRecord
  826.       - procedure VLRGetALogicalRecord(dFName : FnString;
  827.                                        lrNum : LrNumber;
  828.                                        var destination);
  829.       - Get the specified logical record and place it in destination
  830.       - VLOGICAL unit
  831.  
  832.  VLRGetValidLogicalRecords
  833.       - procedure VLRGetValidLogicalRecords(dFName : FnString;
  834.                                             var lrLst : LrList);
  835.       - Returns a list of all logical records for a given variable length
  836.         record data file.  Allows retrievals without use of an index.
  837.       - VLOGICAL unit
  838.  
  839.  VLRStoreALogicalRecord
  840.       - procedure VLRStoreALogicalRecord(dFName : FnString;
  841.                                          lrNum : LrNumber;
  842.                                          var source;
  843.                                          size : DataSizeRange);
  844.       - Stores a logical record in the given variable length record data file.
  845.         Used when the associated logical record number is known
  846.       - VLOGICAL unit
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.                                         13
  857.  
  858.  
  859.  
  860.     TBTREE16             Copyright (c)  1988,1989   Dean H. Farwell II
  861.  
  862.  
  863.  WriteBufferToDisk
  864.       - procedure WriteBufferToDisk(fName : FnString);
  865.       - Writes all dirty buffer pages for a particular file to the
  866.         disk.
  867.       - PAGE unit
  868.  
  869.  WriteEntireBufferToDisk
  870.       - procedure WriteEntireBufferToDisk;
  871.       - Writes all dirty buffer pages to the disk.  Do this prior to
  872.         terminating program
  873.       - PAGE unit
  874.  
  875.  
  876.  
  877.  
  878.  
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.                                         14
  923.  
  924.  
  925.  
  926.     TBTREE16             Copyright (c)  1988,1989   Dean H. Farwell II
  927.  
  928.  
  929.                                    Functions
  930.                                    ---------
  931.  
  932.  CheckImmediateDiskWrite
  933.       - function CheckImmediateDiskWrite : Boolean;
  934.       - Returns true if pages will be immediately written to disk.
  935.         Allows you to check it at any time.
  936.       - PAGE unit
  937.  
  938.  CheckMaxBufferPages
  939.       - function CheckMaxBufferPages : BufferSizeType;
  940.       - Returns maximum buffer pages allowed
  941.       - PAGE unit
  942.  
  943.  CheckPagesInUse
  944.       - function CheckPagesInUse : BufferSizeType;
  945.       - Returns number of pages currently in use
  946.       - PAGE unit
  947.  
  948.  DataRecordUsed
  949.       - function DataRecordUsed(dFName : FnString;
  950.                                 lrNum : LrNumber) : Boolean;
  951.       - Checks the existence of a data record for the given data file
  952.       - LOGICAL unit
  953.  
  954.  FileExists
  955.       - function FileExists(fName : FnString) : Boolean;
  956.       - Checks the existence of any file
  957.       - FILES unit
  958.  
  959.  FindLargestLr
  960.       - function FindLargestLr(lrLst : LrList) : LrNumber;
  961.       - returns the largest logical record in a list.  Probably not
  962.         useful except internally
  963.       - LRECLIST unit
  964.  
  965.  FindLrInList
  966.       - function FindLrInList(lr : LrNumber;
  967.                               lrLst : LrList) : Boolean;
  968.       - Returns true if the given logical record resides in the logical
  969.         record list
  970.       - LRECLIST unit
  971.  
  972.  GetCountLr
  973.       - function GetCountLr(lrLst : LrList) : LrNumber;
  974.       - Returns the number of entries in the logical record list
  975.       - LRECLIST unit
  976.  
  977.  GetCurrLr
  978.       - function GetCurrLr(lrLst : LrList) : LrNumber;
  979.       - Returns the logical record number corresponding to the current
  980.         cursor position.  The cursor position is not changed.
  981.       - LRECLIST unit
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.                                         15
  989.  
  990.  
  991.  
  992.     TBTREE16             Copyright (c)  1988,1989   Dean H. Farwell II
  993.  
  994.  
  995.  GetDataRecordSize
  996.       - function GetDataRecordSize(dFName : FnString) : DataSizeRange;
  997.       - LOGICAL unit
  998.  
  999.  GetFirstLr
  1000.       - function GetFirstLr(var lrLst : LrList) : LrNumber;
  1001.       - Set cursor to front of list and return the first logical record
  1002.         number in the list
  1003.       - LRECLIST unit
  1004.  
  1005.  GetLastLr
  1006.       - function GetLastLr(var lrLst : LrList) : LrNumber;
  1007.       - Set cursor to end of list and return the last logical record
  1008.         number in the list
  1009.       - LRECLIST unit
  1010.  
  1011.  GetNextLr
  1012.       - function GetNextLr(var lrLst : LrList) : LrNumber;
  1013.       - Moves the cursor forward and returns the corresponding logical
  1014.         record number
  1015.       - LRECLIST unit
  1016.  
  1017.  GetNumberOpenFiles
  1018.       - function GetNumberOpenFiles : OpenFileRange;
  1019.       - Returns the number of files which are presently open
  1020.       - FILEBUFF unit
  1021.  
  1022.  GetPrevLr
  1023.       - function GetPrevLr(var lrLst : LrList) : LrNumber;
  1024.       - Moves the cursor backward and returns the corresponding logical
  1025.         record number
  1026.       - LRECLIST unit
  1027.  
  1028.  LastDataRecord
  1029.       - function LastDataRecord(dFName : FnString) : LrNumber;
  1030.       - Returns the logical record of the last valid data record in the given
  1031.         data file
  1032.       - LOGICAL unit
  1033.  
  1034.  NumberOfBTreeLevels
  1035.       - function NumberOfBTreeLevels(iFName : FnString) : Byte;
  1036.       - Return the number of levels for the given index
  1037.       - BTREE unit
  1038.  
  1039.  StoreNewLogicalRecord
  1040.       - function StoreNewLogicalRecord(fName : FnString;
  1041.                                         var source) : LrNumber;
  1042.       - Stores a new logical record in a data file.  Used when the
  1043.         logical record number is not known since this routine returns
  1044.         the logical record number after the store takes place.  You
  1045.         would not use this for an update.
  1046.       - LOGICAL unit
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.                                         16
  1055.  
  1056.  
  1057.  
  1058.     TBTREE16             Copyright (c)  1988,1989   Dean H. Farwell II
  1059.  
  1060.  
  1061.  UsingCursorAndGEValueGetLr
  1062.       - function UsingCursorAndGEValueGetLr(iFName : FnString;
  1063.                                             var paramValue) : LrNumber;
  1064.       - Sets internal cursor to location in the index where the first value
  1065.         greater than or equal to paramValue is found.  Returns 0 if there is no
  1066.         such entry
  1067.       - BTREE unit
  1068.  
  1069.  UsingCursorAndValueGetLr
  1070.       - function UsingCursorAndValueGetLr(iFName : FnString;
  1071.                                           var paramValue) : LrNumber;
  1072.       - Sets internal cursor to location in the index matching paramValue and
  1073.         returns the corresponding logical record number.  Returns 0 if there
  1074.         is no entry matching paramValue.
  1075.       - BTREE unit
  1076.  
  1077.  UsingCursorGetCurrLr
  1078.       - function UsingCursorGetCurrLr(iFName : FnString) : LrNumber;
  1079.       - Does not move the internal cursor.  Only returns the logical record
  1080.         number corresponding to the current cursor position.  Returns 0 if the
  1081.         cursor is not valid.
  1082.       - BTREE unit
  1083.  
  1084.  UsingCursorGetFirstLr
  1085.       - function UsingCursorGetFirstLr(iFName : FnString) : LrNumber;
  1086.       - Sets internal cursor to front of the index and returns the first
  1087.         logical record number.  Returns 0 if there are no entries in the index.
  1088.       - BTREE unit
  1089.  
  1090.  UsingCursorGetLastLr
  1091.       - function UsingCursorGetLastLr(iFName : FnString) : LrNumber;
  1092.       - Sets internal cursor to end of the index and returns the last logical
  1093.         record number.  Returns 0 if there are no entries in the index.
  1094.       - BTREE unit
  1095.  
  1096.  UsingCursorGetNextLr
  1097.       - function UsingCursorGetNextLr(iFName : FnString) : LrNumber;
  1098.       - Moves the internal cursor to the next entry and returns the
  1099.         corresponding logical record number.  Returns 0 if the cursor was not
  1100.         valid or if there is no next entry (you have moved past the end of
  1101.         index.
  1102.       - BTREE unit
  1103.  
  1104.  UsingCursorGetPrevLr
  1105.       - function UsingCursorGetPrevLr(iFName : FnString) : LrNumber;
  1106.       - Moves the internal cursor to the previous entry and returns the
  1107.         corresponding logical record number.  Returns 0 if the cursor was not
  1108.         valid or if there is no previous entry (you have moved past beginning
  1109.         of index.
  1110.       - BTREE unit
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.                                         17
  1121.  
  1122.  
  1123.  
  1124.     TBTREE16             Copyright (c)  1988,1989   Dean H. Farwell II
  1125.  
  1126.  
  1127.  UsingCursorSkipAndGetNextLr
  1128.       - function UsingCursorSkipAndGetNextLr(iFName : FnString) : LrNumber;
  1129.       - Moves the internal cursor to the next entry not equal to the current
  1130.         entry and returns the corresponding logical record number.  In other
  1131.         words, it will skip the cursor over all nonmatching values.  Returns 0
  1132.         if the cursor was not valid or if there is no next nonequal entry (you
  1133.         have moved past the end of index).
  1134.       - BTREE unit
  1135.  
  1136.  UsingCursorSkipAndGetPrevLr
  1137.       - function UsingCursorSkipAndGetPrevLr(iFName : FnString) : LrNumber;
  1138.       - Moves the internal cursor to the previous entry not equal to the
  1139.         current entry and returns the corresponding logical record number.  In
  1140.         other words, it will skip the cursor over all nonmatching values.
  1141.         Returns 0 if the cursor was not valid or if there is no previous
  1142.         nonequal entry (you have moved past the beginning of index).
  1143.       - BTREE unit
  1144.  
  1145.  VLRDataRecordUsed
  1146.       - function VLRDataRecordUsed(dFName : FnString;
  1147.                                    lrNum : LrNumber) : Boolean;
  1148.       - Checks the existence of a data record for the given variable length
  1149.         record data file
  1150.       - VLOGICAL unit
  1151.  
  1152.  VLRGetDataRecordSize
  1153.       - function VLRGetDataRecordSize(dFName : FnString;
  1154.                                       lrNum : LrNumber) : DataSizeRange;
  1155.       - Returns the data record size for the given variable length record data
  1156.         file.  Used mostly internally
  1157.       - VLOGICAL unit
  1158.  
  1159.  VLRLastDataRecord
  1160.       - function VLRLastDataRecord(dFName : FnString) : LrNumber;
  1161.       - Returns the logical record of the last valid data record in the given
  1162.         variable length record data file
  1163.       - VLOGICAL unit
  1164.  
  1165.  VLRStoreNewLogicalRecord
  1166.       - function VLRStoreNewLogicalRecord(dFName : FnString;
  1167.                                           var source;
  1168.                                           size : DataSizeRange) : LrNumber;
  1169.       - Stores a new logical record in a variable length record data file.
  1170.         Used when the logical record number is not known since this routine
  1171.         returns the logical record number after the store takes place.  You
  1172.         would not use this for an update.
  1173.       - VLOGICAL unit
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.                                         18
  1187.  
  1188.  
  1189.