home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / PASCAL / TPDB32 / TPDB.DOC < prev    next >
Text File  |  1991-10-28  |  55KB  |  1,942 lines

  1. This  documentation   was  written  using   Borland's  MicroStar  word
  2. processor.
  3.  
  4. THIS  SOFTWARE IS  PROTECTED BY  A COPYRIGHT  DULY REGISTERED WITH THE
  5. U.S. COPYRIGHT OFFICE. PIRACY WILL NOT  GO UNPUNISHED (IN THIS LIFE OR
  6. THE NEXT.)
  7.  
  8.                      (****************************************)
  9.                      (*               TPDB 3.20              *)
  10.                      (*     Turbo Pascal Tools for dBASE     *)
  11.                      (*                                      *)
  12.                      (*           Turbo Pascal 6.0           *)
  13.                      (*  Object - Oriented Database Toolbox  *)
  14.                      (*    Utilizing dBASE Compatible Data   *)
  15.                      (*                Files                 *)
  16.                      (*                                      *)
  17.                      (*            Copyright 1991            *)
  18.                      (*               Brian Corll            *)
  19.                      (*          All Rights Reserved         *)
  20.                      (*      dBASE, dBASE III, and dBASE     *)
  21.                      (*      III Plus are registered         *)
  22.                      (*    trademarks of Ashton-Tate Corp.   *)
  23.                      (*                                      *)
  24.                      (*    Turbo Pascal is a registered      *)
  25.                      (*    trademark of Borland Int. Corp.   *)
  26.                      (*                                      *)
  27.                      (*     Version 3.20  October,1991       *)
  28.                      (*                                      *)
  29.                      (****************************************)
  30.                      (*     Portions copyright 1984,1991 by  *)
  31.                      (*       Borland International Corp.    *)
  32.                      (****************************************)
  33.  
  34.  
  35.             TPDB is  a toolbox of  Turbo Pascal 6.0  units which allow
  36.             you  to access,  index,  search,  read and  write database
  37.             files that were created with  dBASE III or III Plus, using
  38.             75+   Turbo  Pascal   procedures  and   functions  written
  39.             specifically   for   these   purposes,   and  implementing
  40.             object-oriented techniques. This toolbox supports multiple
  41.             data  files  and  associated   indexes (NOT dBASE INDEXES !)
  42.             limited only by available  memory and file handles allowed
  43.             by DOS. Index keys can be up to 254 characters, and can be
  44.             composed of multiple fields  or expressions which evaluate
  45.             to a string not longer than 254 characters.
  46.  
  47.            ************************************************************
  48.            *             My CompuServe ID is 73067,3310.              *
  49.            ************************************************************
  50.  
  51.             This  program  is  being  distributed  under the Shareware
  52.             concept.
  53.  
  54.             If you like this program and use it, a registration fee of
  55.             $ 19.95 is required for non-profit users. Commercial users
  56.             MUST  register for  a one-time,  royalty-free registration
  57.             fee of $ 39.95. Registered  users will receive source code
  58.             for TPDB.tpu, TPDBDATE.tpu, TPDBScrn.tpu, TPDBStr.tpu, and
  59.             TPDBSort.tpu. See the file REGISTER.FRM. Registration also
  60.             includes free technical support, within the limitations of
  61.             my time and resources.
  62.  
  63.             NOTA BENE:  This registration fee is  intended to cover my
  64.             personal  time  and  expense  in  developing, documenting,
  65.             distributing,  and supporting  this toolbox,  and does not
  66.             constitute the sale of the code contained therein.
  67.  
  68.  
  69.             Write to:
  70.  
  71.                          SoftIron
  72.                          Brian Corll
  73.                          1002 East Simpson Street
  74.                          Mechanicsburg,PA  17055
  75.  
  76.             Make checks payable to Brian Corll.
  77.  
  78.             DISCLAIMER
  79.  
  80.             This program  is provided "as is"  without warranty of any
  81.             kind, either express or  implied, included but not limited
  82.             to the implied warranty of merchantability and fitness for
  83.             a specific purpose. The entire  risk as to the quality and
  84.             performance of this program is with you.
  85.  
  86.             In  no event  will the  author be  liable to  you for  any
  87.             damages, including any lost profits, lost savings or other
  88.             incidental or consequential damages arising out of the use
  89.             of or inability to use this program.
  90.  
  91.             That said, please  be assured that I have  spent many long
  92.             hours trying to make this toolbox  the best it can be, and
  93.             I'm working to make it even better !
  94.  
  95. (**********************************)
  96. (* Interface Listing for TPDB.pas *)
  97. (**********************************)
  98.  
  99.  
  100. Unit TPDB;
  101.  
  102. {This version is Version 3.20 October, 1991}
  103.  
  104.  
  105.                      (***********************************)
  106.                      (*         Object -Oriented        *)
  107.                      (*     Turbo Pascal 6.0 Unit       *)
  108.                      (*    for Accessing dBASE III      *)
  109.                      (*             files.              *)
  110.                      (*        Copyright 1991           *)
  111.                      (*          Brian Corll            *)
  112.                      (*       All Rights Reserved       *)
  113.                      (*     dBASE is a registered       *)
  114.                      (* trademark of Ashton-Tate, Inc.  *)
  115.                      (*   Version 3.20 October,1991     *)
  116.                      (***********************************)
  117.                      (*   Portions Copyright 1984,1991  *)
  118.                      (*    Borland International Corp.  *)
  119.                      (***********************************)
  120.  
  121.  
  122. INTERFACE
  123.  
  124. Uses CRT,Dos,TPDBINDX,TPDBDate,TPDBScrn,TPDBStr;
  125.  
  126.  
  127. (******************************)
  128. (*      Global VARiables      *)
  129. (******************************)
  130.  
  131. CONST
  132.  
  133.   (**************************************************************************)
  134.    MaxInds = 10; {Maximum number of indexes per file.  Change this as needed.}
  135.   (**************************************************************************)
  136.  
  137.   AutoWrap    : Boolean = FALSE;
  138.   {Set this to TRUE to enable wrapping of field input.}
  139.  
  140.   { These are screen editing control keys:
  141.   CursorDown  = ^X;
  142.   CursorEND   = ^F;
  143.   CursorHome  = ^A;
  144.   CursorLeft  = ^S;
  145.   CursorRight = ^D;
  146.   CursorUp    = ^E;
  147.   DelKey      = ^G;
  148.   Escape      = ^[;
  149.   ExtKey       : Boolean = FALSE;
  150.   PageDown     = ^C;
  151.   PageUp       = ^R;
  152.   Return       = ^M;
  153.   TabKey       = #9;}
  154.  
  155.   { These constants determine whether or not index keys are unique:
  156.   NoDuplicates = 0;
  157.   Duplicates  =  1;}
  158.  
  159.   Filler  :  Char  =  #32;  {This  is  the character displayed for blank
  160.   portion of fields during editing and display.}
  161.  
  162.   {Numeric processing minimum and maximum values
  163.   MaxLong      = 2147483647;
  164.   MaxReal      = 3.4E37;
  165.   MinLong      = -2147483647;
  166.   MinReal      = 1.5E-45;}
  167.  
  168.  
  169.  
  170.   UpperCase  : Boolean  = FALSE;  {Turns upper  case conversion ON/OFF
  171.   during screen input.}
  172.  
  173.   {Date format constants}
  174.   {Used by SetDateFormat procedure}
  175.   French   = 1; {dd/mm/yy}
  176.   German   = 2; {dd.mm.yy}
  177.   Italian  = 3; {dd-mm-yy}
  178.   American = 4; {mm/dd/yy}
  179.   British  = 5; {dd/mm/yy}
  180.   Ansi     = 99;{yy.mm.dd}
  181.  
  182.  
  183.  
  184. Type
  185.   Str2     = String[2];
  186.   Str4     = String[4];
  187.   Str5     = String[5];
  188.   Str6     = String[6];
  189.   Str8     = String[8];
  190.   Str10    = String[10];
  191.   Str15    = String[15];
  192.   Str20    = String[20];
  193.   Str30    = String[30];
  194.   Str60    = String[60];
  195.   Str80    = String[80];
  196.   Str132   = String[132];
  197.   Str254   = String[254];
  198.   CharSet  = Set of Char;
  199.   ByteSet  = Set of Byte;
  200.  
  201.   FileName = String[66];
  202.   DBRecPtr = ^DBType;
  203.   DBType   = Array[1..4000] of Char;  (* dBASE record buffer *)
  204.  
  205.           DBHeader = RECORD  (* dBASE file header *)
  206.           DBType    : Byte;
  207.           Year      : Byte;
  208.           Month     : Byte;
  209.           Day       : Byte;
  210.           RecCount  : LongInt;
  211.           Location  : Integer;
  212.           RecordLen : Integer;
  213.           Reserved  : Array[1..20] of Byte;
  214.           Terminator : Char;
  215.           END;
  216.  
  217.           DBField = Record (* DBF field descriptors *)
  218.           FieldName    : Array[1..11] of Char;
  219.           FieldType    : Byte;
  220.           FieldAddress : LongInt;
  221.           FieldLen     : Byte;
  222.           FieldDec     : Byte;
  223.           Reserved     : Array[1..14] of Char;
  224.           END;
  225.  
  226.           HeadPtr = ^DBHeader;
  227.           PosPtr = ^DBEditArray;
  228.           FieldPtr = ^FieldArray;
  229.           DBEditArray = Array[1..2,1..128] of Integer;
  230.           FieldArray  = Array[1..128] of DBField;
  231.  
  232.           DBIndex = RECORD  (* Index file control  record *)
  233.           Ndx : IndexFile;
  234.           NdxID : BYTE;
  235.           NdxName : FileName;
  236.           Open : BOOLEAN;
  237.           END;
  238.  
  239.           NdxArray = ARRAY[1..MaxInds] OF DBIndex;
  240.           NdxPtr = ^NdxArray;
  241.  
  242. (*****************************************************************************)
  243. (*             Database File Object Declaration                              *)
  244. (*****************************************************************************)
  245.  
  246.    DataObject = ^DBF;
  247.  
  248.    DBF =  OBJECT     {The main, and only, object.}
  249.        DBFName     : FileName;
  250.        DBFile      : File;
  251.        Header      : HeadPtr;
  252.        Fields      : FieldPtr;
  253.        Positions   : ^DBEditArray;
  254.        DBFOpen     : BOOLEAN;
  255.        IndsOpen    : BOOLEAN;
  256.        Indexes     : NdxPtr;
  257.        DBRecord    : ^DBType;
  258.        DBRecNum    : LONGINT;
  259.        TotalRecs   : LONGINT;
  260.        NumFields   : BYTE;
  261.        MAlloc      : BOOLEAN;
  262.        Start,Stop  : INTEGER;
  263.        FUNCTION    Add(Field1,Field2 : Byte):string;
  264.        PROCEDURE   AddDBKey(NdxID : BYTE;KeyStr : DBKey);
  265.        PROCEDURE   AddDBRec;
  266.        FUNCTION    Allocated : BOOLEAN;
  267.        PROCEDURE   AppendBlank;
  268.        PROCEDURE   BailOut;
  269.        FUNCTION    BinSearch(FieldNo : BYTE;
  270.         Position : Integer;SearchKey : DBKey) : LONGINT;
  271.        FUNCTION    BOF : Boolean;
  272.        PROCEDURE   CloseDBIndex(NdxID : BYTE);
  273.        PROCEDURE   DBReset;
  274.        PROCEDURE   DelDBKey(KeyStr : DBKey;NdxID : BYTE);
  275.        FUNCTION    Deleted : Boolean;
  276.        PROCEDURE   Display;
  277.        FUNCTION    Divide(Field1,Field2 : Byte):string;
  278.        DESTRUCTOR  Done;
  279.        FUNCTION    DBEOF : BOOLEAN;
  280.        FUNCTION    Field(FNo : Byte) : string;
  281.        PROCEDURE   FillRecs(NumRecs : LongInt);
  282.        PROCEDURE   Find(NdxID : BYTE;SearchStr : string);
  283.        PROCEDURE   FlushDB;
  284.        PROCEDURE   Get(FNo,X,Y : Byte);
  285.        PROCEDURE   GetDBRec(RecordNumber : LongInt);
  286.        FUNCTION    GetField(RecordNo : LongInt;FNo : Byte) : String;
  287.        PROCEDURE   GoBottom;
  288.        PROCEDURE   GoTop;
  289.        FUNCTION    IIF(BoolVAR : Boolean;IfTRUE,IfFALSE : String) : String;
  290.        PROCEDURE   IndexOn(NdxID : BYTE;NdxName : FileName;
  291.                         NdxField : BYTE;DupFlag : BYTE);
  292.        CONSTRUCTOR Init(DBName : FileName);
  293.        FUNCTION    LastRec : LONGINT;
  294.        FUNCTION    Locate(FieldNo : BYTE;SearchStr : String) : BOOLEAN;
  295.        PROCEDURE   LookUp(SearchStr : string;NdxID : BYTE);
  296.        PROCEDURE   MakeDBIndex(NdxID : BYTE;DBIndexName : FileName;KeyLen,Status : Integer);
  297.        PROCEDURE   Mark;
  298.        FUNCTION    Mul(Field1,Field2 : Byte):string;
  299.        PROCEDURE   NextDBKey(NdxID : BYTE;KeyStr : DBKey);
  300.        PROCEDURE   NewDBRec;
  301.        PROCEDURE   NextRec;
  302.        PROCEDURE   OpenDBIndex(NdxID : BYTE;DBIndexName : FileName;KeyLen,Status : Integer);
  303.        PROCEDURE   Pack;
  304.        PROCEDURE   PrevDBKey(NdxID : BYTE;KeyStr : DBKey);
  305.        PROCEDURE   PrevRec;
  306.        PROCEDURE   PutDBRec(RecordNumber : LongInt);
  307.        PROCEDURE   ReadDBHeader;
  308.        PROCEDURE   Recall;
  309.        FUNCTION    RecCount : LONGINT;
  310.        FUNCTION    RecNo : LONGINT;
  311.        PROCEDURE   Repl(FNo : Byte;InStr : string);
  312.        PROCEDURE   ReplEach(FNo : Byte;InStr : String);
  313.        PROCEDURE   Save;
  314.        PROCEDURE   Say(FNo,Row,Col : Byte);
  315.        PROCEDURE   SetIndexTo(NdxID : Byte);
  316.        PROCEDURE   ShowStatus;
  317.        PROCEDURE   Skip(NumRecs : Longint);
  318.        FUNCTION    Sub(Field1,Field2 : Byte) : string;
  319.        FUNCTION    Sum(FNo : Byte) : Real;
  320.        PROCEDURE   WriteDBHeader;
  321.        PROCEDURE   Zap;
  322.        END;
  323.  
  324. (****************************************************************************)
  325. (*          END Object Declaration                                          *)
  326. (****************************************************************************)
  327.  
  328. Const
  329.  
  330.         Up   : CharSet = [CursorUp];
  331.         Down : CharSet = [CursorDown,Return];
  332.         Next : CharSet = [Escape];
  333.  
  334. VAR
  335.         FilesOpen : BYTE;
  336.         UCKey : BOOLEAN;
  337.         ErrCode : INTEGER;
  338.         Found : BOOLEAN;
  339.         Ch,BC : CHAR;
  340.         Normal,Reverse : BYTE;
  341.         Decimals : Byte;
  342.         TempFile : File;
  343.         K : Byte;
  344.         NumLen : Byte;
  345.         Y,M,D,DW : WORD;
  346.         FromPack : BOOLEAN;
  347.         DateFormat : BYTE;
  348.  
  349. (**********************************)
  350. (*   PROCEDUREs and FUNCTIONs     *)
  351. (**********************************)
  352.  
  353. PROCEDURE Beep;
  354. {Sound a couple of tones.}
  355.  
  356. FUNCTION BoolToStr(Param : Byte;IfTRUE,IfFALSE : Char): String;
  357.  
  358.  
  359. PROCEDURE CheckScreen(VAR CurrPos:Byte;BC:Char;Up,Down:CharSet;Low,High:Byte);
  360. {Used in full screen editing.}
  361.  
  362. PROCEDURE CopyFile(Source,Dest : FileName);
  363.  
  364. PROCEDURE FlashFill(Row,Col,Rows,Cols,Attr : Byte;Ch : Char);
  365. {Fill a region of the screen with a specified color and character.}
  366.  
  367. FUNCTION GetBoolean(VAR Param:Byte;IfTRUE,IfFALSE:Char;X,Y:Byte):Char;
  368.  
  369. FUNCTION GetByte(VAR Param:Byte;LowLim,UpLim,Len,X,Y:Byte):Char;
  370.  
  371. FUNCTION GetInteger(VAR Param:Integer;LowLim,UpLim:Integer;Len,X,Y:Byte):Char;
  372. {Input an integer.}
  373.  
  374. FUNCTION GetLongInt(VAR Param:LongInt;LowLim,UpLim:LongInt;Len,X,Y:Byte):Char;
  375. {Input a long integer.}
  376.  
  377. FUNCTION GetReal(VAR Param : Real; LowLim, UpLim : Real; Len, X, Y : Word) : Char;
  378. {Input a real number.}
  379.  
  380. FUNCTION GetString(VAR Param : String; Len, X, Y : Byte) : Char;
  381. {Input a string.}
  382.  
  383. FUNCTION Input(VAR S:String;Term:CharSet;L,X,Y:Byte;VAR BC:Char):String;
  384.  
  385. FUNCTION IntToStr(Number : LongInt): String;
  386.  
  387. FUNCTION Max(N1,N2 : Integer) : Integer;
  388.  
  389. FUNCTION Min(N1,N2 : Integer) : Integer;
  390.  
  391. PROCEDURE Prompt(Row,Col : Byte;PromptStr : Str80);
  392. {Display a prompt at a specified row and column.}
  393.  
  394. FUNCTION ReadChar : Char;
  395.  
  396. PROCEDURE ReadKB (VAR ExtKey: Boolean; VAR Ch: Char);
  397.  
  398. FUNCTION RealToStr(Number : Real): String;
  399.  
  400. PROCEDURE SetDateFormat(Format : BYTE);
  401.  
  402. PROCEDURE SetDBColor(FG,BG : Byte);
  403. {Set initial foreground and background colors.}
  404.  
  405. PROCEDURE Wait;
  406. {Wait for a key press and display a message.}
  407.  
  408.         (************************************************************)
  409.         (*  Documentation for Procedures and Functions in TPDB.tpu  *)
  410.         (************************************************************)
  411.  
  412.             Add function
  413.  
  414.             Function
  415.  
  416.                         Adds two numeric fields
  417.  
  418.             Syntax
  419.  
  420.                         Add(Field1,Field2 : Byte);
  421.  
  422.             Remarks
  423.  
  424.                         Field1 and Field2 are the order numbers of the
  425.                         respective fields  as they appear  in the .DBF
  426.                         structure.
  427.  
  428.             *************************
  429.  
  430.             AddDBKey procedure
  431.  
  432.             Function Adds a key string  to the index currently in
  433.             use.
  434.  
  435.             Syntax
  436.                          AddDBKey(NdxID : BYTE;KeyStr : DBKey);
  437.  
  438.             Remarks
  439.  
  440.                          KeyStr  is  any  string  not  longer than 254
  441.                          characters.  A field  must be  converted to a
  442.                          string  by  using   the  Field  function
  443.                          (q.v.).
  444.  
  445.                          NdxID is the index ID number.
  446.  
  447.             Restrictions
  448.  
  449.                          Length(KeyStr) must be in the range of 1..254
  450.                          characters. All expressions  must evaluate to
  451.                          a single string not  more than 254 characters
  452.                          in length.
  453.  
  454.  
  455.             *************************
  456.  
  457.             AddDBRec procedure
  458.  
  459.             Function
  460.  
  461.                         Adds a new record to the .DBF file in use.
  462.  
  463.             Syntax
  464.  
  465.                         AddDBRec;
  466.  
  467.             Remarks
  468.  
  469.                         A new record must first be created with a call
  470.                         to the NewDBRec procedure.
  471.  
  472.             ************************
  473.  
  474.             AppendBlank procedure
  475.  
  476.             Function
  477.  
  478.                        Appends  a  new  blank  record  to  the current
  479.                        database file.
  480.  
  481.             Syntax
  482.  
  483.                        AppendBlank;
  484.  
  485.             ***********************
  486.  
  487.             BinSearch function
  488.  
  489.             Function
  490.  
  491.                        Performs  a  binary  search  on  a  sorted
  492.                        database,  searching for  s specified  key
  493.                        string in a specified field, starting from
  494.                        a  specific  position  within  the  field.
  495.             Syntax
  496.  
  497.                        BinSearch(FieldNo : BYTE;Position : Integer;
  498.                         SearchKey : DBKey) : LONGINT;
  499.  
  500.             ***********************
  501.  
  502.             BlockCursor procedure
  503.  
  504.             Function
  505.  
  506.                         Turns on a block cursor.
  507.  
  508.             Syntax
  509.  
  510.                         BlockCursor;
  511.  
  512.             ************************
  513.  
  514.             BOF function
  515.  
  516.             Function
  517.  
  518.                         Returns  beginning of  file status  of a  .DBF
  519.                         file.
  520.  
  521.             Syntax
  522.  
  523.                         BOF
  524.  
  525.             Result Type
  526.  
  527.                         Boolean
  528.  
  529.  
  530.  
  531.             ************************
  532.  
  533.             CalcDate function
  534.  
  535.             Function
  536.  
  537.                         Add or subtract days,months, or years from two
  538.                         dates.
  539.  
  540.             Syntax
  541.  
  542.                         CalcDate(InDate:DateStr;Days,Months,Years:
  543.                         integer): DateStr;
  544.  
  545.             *************************
  546.  
  547.             CDOW function
  548.  
  549.             Function
  550.  
  551.                         Returns   character   day   of   week  -  i.e.
  552.                         'Monday','Tuesday',etc.
  553.  
  554.             Syntax
  555.  
  556.                         CDOW(InDate : DateStr): DayStr;
  557.  
  558.             *************************
  559.  
  560.             CMonth function
  561.  
  562.             Function
  563.  
  564.                         Returns character month - i.e. 'March'
  565.  
  566.             Syntax
  567.  
  568.                         CMonth(InDate : DateStr) : Str9;
  569.  
  570.             *************************
  571.  
  572.             ChAttr procedure
  573.  
  574.             Function
  575.  
  576.                         Changes   the  display   attribute  of  a
  577.                         specified  number  of   characters  on  a
  578.                         specified line.
  579.  
  580.             Syntax
  581.  
  582.                         ChAttr(Number : Word; Row, Col, Attr : Word);
  583.  
  584.             Remarks
  585.  
  586.                         This procedure is contained in ATTR.obj.
  587.  
  588.            **************************
  589.  
  590.            ChAllAttr procedure
  591.  
  592.            Function
  593.  
  594.                         Changes   the  display   attribute  of  a
  595.                         specified screen block.
  596.  
  597.  
  598.            Syntax
  599.  
  600.                         ChAllAttr(Row,Col,Rows,Cols,Attr : Word);
  601.  
  602.            **************************
  603.  
  604.             CheckScreen procedure
  605.  
  606.             Function
  607.  
  608.                         Checks the current  field being edited against
  609.                         minimum   and   maximum   limits   of   fields
  610.                         displayed.
  611.                                      K
  612.             Syntax
  613.  
  614.                         CheckScreen(VarCurrPos:Byte;BC:Char;Up,Down:CharSet;
  615.                         Low,High:Byte);
  616.  
  617.             Remarks
  618.  
  619.                         CurrPos is  the number of  the field currently
  620.                         being edited in the editing loop (see DEMO.pas
  621.                         for an example).
  622.  
  623.                         BC  is  the  terminating  character when field
  624.                         editing has been completed.
  625.  
  626.                         Up  and  Down  are  the  character  sets which
  627.                         contain the terminating characters which allow
  628.                         you to  move from one field  to another, up or
  629.                         down. In TPDB, they  are declred as constants,
  630.                         as follows:
  631.  
  632.                                 Up : CharSet = [CursorUp]; Down :
  633.                                 CharSet = [CursorDown,Return];
  634.  
  635.  
  636.                         Low and  High are the low  and high numbers of
  637.                         the displayed fields.
  638.  
  639.             ************************
  640.  
  641.             CloseDBFile procedure
  642.  
  643.             Function
  644.  
  645.                         Closes the currently open .DBF file.
  646.  
  647.             Syntax
  648.  
  649.                         CloseDBFile;
  650.  
  651.             Remarks
  652.  
  653.                         This procedure is error-checked.
  654.  
  655.             ************************
  656.  
  657.             CloseDBIndex procedure
  658.  
  659.             Function
  660.  
  661.                         Closes the index currently in use.
  662.  
  663.             Syntax
  664.  
  665.                         CloseDBIndex(NdxID : BYTE);
  666.  
  667.             Remarks
  668.  
  669.                         NdxID is a number  assigned to the index. This
  670.                         procedure is error-checked.
  671.  
  672.             ************************
  673.  
  674.             CompDates function
  675.  
  676.             Function
  677.  
  678.                         Compares two  dates and calculates  the number
  679.                         of days between them.
  680.  
  681.             Syntax
  682.  
  683.                         CompDates(Date1,Date2 : DateStr):Word;
  684.  
  685.             *************************
  686.  
  687.             CTOD function
  688.  
  689.             Function
  690.  
  691.                         Converts  a .DBF  compatible date  field to  a
  692.                         word date type for date arithmetic.
  693.  
  694.             Syntax
  695.  
  696.                         CTOD(InDate: DateStr) : DateType;
  697.  
  698.             *************************
  699.  
  700.             CursorOn and CursorOff procedures
  701.  
  702.             Function
  703.  
  704.                         Turn cursor on and off
  705.  
  706.             Syntax
  707.  
  708.                         CursorOn; CursorOff;
  709.  
  710.                         Externally declared in Flash.obj.
  711.  
  712.             *************************
  713.  
  714.  
  715.             DBReset procedure
  716.  
  717.             Function
  718.  
  719.                         Resets a .DBF file, moving the file pointer to
  720.                         record 1.
  721.  
  722.             Syntax
  723.  
  724.                         DBReset;
  725.  
  726.             Remarks
  727.  
  728.                         This procedure is error-checked.
  729.  
  730.             ************************
  731.  
  732.             DelDBKey procedure
  733.  
  734.             Function
  735.  
  736.                         Deletes a key string in the index currently in
  737.                         use.
  738.  
  739.             Syntax
  740.  
  741.                         DelDBKey(KeyStr : DBKey;NdxID : BYTE);
  742.  
  743.             Remarks
  744.  
  745.                          See documentation for AddDBKey procedure.
  746.  
  747.  
  748.  
  749.             *************************
  750.  
  751.  
  752.             Deleted function
  753.  
  754.             Function
  755.  
  756.                         Returns  True if  the curent  record has  been
  757.                         marked for deletion, False  if it has not been
  758.                         marked.
  759.  
  760.             Syntax
  761.  
  762.                         Deleted : boolean;
  763.  
  764.  
  765.             ************************
  766.  
  767.             Display procedure
  768.  
  769.             Function
  770.  
  771.                         Displays  the  current  record  in a partially
  772.                         formatted manner.
  773.  
  774.             Syntax
  775.  
  776.                         Display;
  777.  
  778.             Remarks
  779.  
  780.                         Date fields are formatted as MM/DD/YY.
  781.  
  782.             *************************
  783.  
  784.             Divide function
  785.  
  786.             Function
  787.  
  788.                         Divides field1 BY field2
  789.  
  790.             Syntax
  791.  
  792.                         Divide(Field1,Field2 : Byte):string;
  793.  
  794.             Remarks
  795.  
  796.                         Field1 and Field2 are the order numbers of the
  797.                         respective fields  as they appear  in the .DBF
  798.                         structure.
  799.  
  800.             *************************
  801.  
  802.             Done DESTRUCTOR
  803.  
  804.             This  destructor MUST  be called  when closing  a database
  805.             file. Calling this procedure closes all associated indexes
  806.             at the same time.
  807.  
  808.             Syntax
  809.             VAR
  810.                Example : DataObject;
  811.  
  812.                         DISPOSE(Example^,Done);
  813.  
  814.  
  815.             *************************
  816.  
  817.             DTOC function
  818.  
  819.             Function
  820.  
  821.                         Converts  a   word  date  type   to  a  string
  822.                         compatible with .DBF date fields.
  823.  
  824.             Syntax
  825.  
  826.                         DTOC(Julian: DateType) : DateStr;
  827.  
  828.             *************************
  829.  
  830.             EOF function
  831.  
  832.             Function
  833.  
  834.                         Returns end-of-file status of a .DBF file.
  835.  
  836.             Syntax
  837.  
  838.                         EOF
  839.  
  840.             Return Type
  841.  
  842.                         Boolean
  843.  
  844.             ************************
  845.  
  846.             Field function
  847.  
  848.             Function
  849.  
  850.                         Returns the string value  of a specified field
  851.                         in a specified record in a .DBF file.
  852.  
  853.             Syntax
  854.  
  855.                         Field(FNo : Byte) : string;
  856.  
  857.             Remarks
  858.  
  859.                         FNo  is the  number of  the field  in the .DBF
  860.                         file structure. Date fields are not formatted.
  861.  
  862.             ************************
  863.  
  864.             FillRecs procedure
  865.  
  866.             Function
  867.  
  868.                         Appends a specified number of blank records to
  869.                         a .DBF file.
  870.  
  871.             Syntax
  872.  
  873.                         FillRecs(NumRecs : LongInt);
  874.  
  875.             ************************
  876.  
  877.             Find procedure
  878.  
  879.             Function
  880.  
  881.                         Searches  for a  string in  the currently open
  882.                         index.
  883.  
  884.             Syntax
  885.  
  886.                         Find(NdxID : BYTE;SearchStr : string);
  887.  
  888.             Remarks
  889.                          NdxID  is  the  ID  number  assigned  to  the
  890.                          current  index.  If  the  string  is found, a
  891.                          value  of  True  is  returned  in  the global
  892.                          boolean variable Found. If  the string is not
  893.                          found, a value of False is returned in Found.
  894.  
  895.             ************************
  896.  
  897.             Flash procedure
  898.  
  899.             Function
  900.  
  901.                         Writes a string at a specified row and column,
  902.                         using a  specified attribute, by  direct video
  903.                         access.
  904.  
  905.             Syntax
  906.  
  907.                         Flash(Row,Col, Attr:byte; Str : String);
  908.  
  909.             Remarks
  910.  
  911.                         When  setting attribute,  constant folding can
  912.                         be  used.  See   color  constants  in  globals
  913.                         section.
  914.  
  915.             ************************
  916.  
  917.             FlashC procedure
  918.  
  919.             Function
  920.  
  921.                         Writes a  centered string at  a specified row,
  922.                         using a  specified attribute, by  direct video
  923.                         access.
  924.  
  925.             Syntax
  926.  
  927.                         FlashC(Row,Attr:Byte;Str : String);
  928.  
  929.             Remarks
  930.  
  931.                         See remarks for Flash procedure.
  932.  
  933.             ************************
  934.  
  935.             FlashFill procedure
  936.  
  937.             Function
  938.  
  939.                         Fills   a  specified   screen  block   with  a
  940.                         specified character and attribute.
  941.  
  942.             Syntax
  943.  
  944.                         FlashFill(Row,Col,Rows,Cols,Attr        :
  945.                         Byte;Ch : Char);
  946.  
  947.             Remarks
  948.  
  949.                         See remarks for other Flash procedures.
  950.  
  951.             ************************
  952.  
  953.  
  954.             FlushDB procedure
  955.  
  956.             Function
  957.  
  958.                         Flushes  records currently  in memory  to disk
  959.                         file.
  960.  
  961.             Syntax
  962.  
  963.                         FlushDB;
  964.  
  965.             Remarks
  966.  
  967.                         This procedure is error-checked.
  968.  
  969.  
  970.             ************************
  971.  
  972.             FormDate function
  973.  
  974.             Function
  975.  
  976.                         Formats a date string as stored in a .DBF file
  977.                         in the 'MM/DD/YY' format.
  978.  
  979.             Syntax
  980.  
  981.                         FormDate(InDate:DateStr):String;
  982.  
  983.             *************************
  984.  
  985.             Get procedure
  986.  
  987.             Function
  988.  
  989.                         Edits  a  specified  field  in  the  .DBF at a
  990.                         specified row and column.
  991.  
  992.             Syntax
  993.  
  994.                         Get(FieldNumber,Row,Col : Byte);
  995.  
  996.             Remarks
  997.  
  998.                         The following editing keys are active:
  999.  
  1000.                         Left  cursor
  1001.                         Right  cursor
  1002.                         Home
  1003.                         End
  1004.                         Backspace
  1005.                         Delete
  1006.                         Ctrl-Y (Deletes the entire field.)
  1007.  
  1008.  
  1009.             ************************
  1010.  
  1011.             GetDBRec procedure
  1012.  
  1013.             Function
  1014.  
  1015.                         Locates and reads a specified record in a .DBF
  1016.                         file.
  1017.  
  1018.             Syntax
  1019.  
  1020.                         GetDBRec(RecordNumber : LongInt);
  1021.  
  1022.             ************************
  1023.  
  1024.  
  1025.             GetString procedure
  1026.  
  1027.             Function
  1028.  
  1029.                         Allows  screen  input  of  a  string,  as in a
  1030.                         search procedure.
  1031.  
  1032.             Syntax
  1033.  
  1034.                         GetString(Var Parameter : String; Length,
  1035.                         Row, Col : Byte) : Char;
  1036.  
  1037.             ************************
  1038.  
  1039.             GoBottom procedure
  1040.  
  1041.             Function
  1042.  
  1043.                         Set the file pointer at the end of file.
  1044.  
  1045.             Syntax
  1046.  
  1047.                         GoBottom;
  1048.  
  1049.             ************************
  1050.  
  1051.             GoTop procedure
  1052.  
  1053.             Function
  1054.  
  1055.                         Sets  the  file  pointer  at  the beginning of
  1056.                         file.
  1057.  
  1058.             Syntax
  1059.  
  1060.                         GoTop;
  1061.  
  1062.             ************************
  1063.  
  1064.  
  1065.             IIF function
  1066.  
  1067.             Function
  1068.  
  1069.                         Evaluates  a  boolean  variable  and returns a
  1070.                         string according to the value of the boolean.
  1071.  
  1072.             Syntax
  1073.  
  1074.                         IIF(BoolVar  :  Boolean;IfTrue,IfFalse  :
  1075.                         String) : String;
  1076.  
  1077.             ************************
  1078.  
  1079.             IndexOn procedure
  1080.  
  1081.             Function
  1082.  
  1083.                         Builds an index on a specified key field.
  1084.  
  1085.             Syntax
  1086.  
  1087.                         IndexOn(NdxID : BYTE;NdxName : FileName;
  1088.                           NdxField : BYTE;DupFlag : BYTE);
  1089.  
  1090.             Remarks
  1091.                         NdxID is an ID  number assigned to the current
  1092.                         index.  DupFlag  may  be  a  constant  such as
  1093.                         Duplicates or NoDuplicates.
  1094.  
  1095.             ************************
  1096.  
  1097.             Init CONSTRUCTOR
  1098.  
  1099.             Function
  1100.  
  1101.                         Initializes  a  data   object  and  opens  the
  1102.                         associated DBF file.
  1103.  
  1104.             Syntax
  1105.  
  1106.                         Init(DBName : FileName);
  1107.             VAR
  1108.                   Example : DataObject;
  1109.  
  1110.                         NEW(Example,Init('example.dbf'));
  1111.  
  1112.             ************************
  1113.  
  1114.             JustL function
  1115.  
  1116.             Function
  1117.  
  1118.                         Left   justifies   a   string   within  a
  1119.                         specified field length.
  1120.  
  1121.             Syntax
  1122.  
  1123.                         JustL(InString:     String;     FieldLen:
  1124.                         Integer): String;
  1125.  
  1126.             ************************
  1127.  
  1128.             LTrim function
  1129.  
  1130.             Function
  1131.  
  1132.                         Trims leading spaces from a string.
  1133.  
  1134.             Syntax
  1135.  
  1136.                         LTrim(InStr: String): String;
  1137.  
  1138.             *************************
  1139.  
  1140.             Locate procedure
  1141.  
  1142.             Function
  1143.  
  1144.                         Searches sequentially through a DBF file for a
  1145.                         specified search string, stopping at the first
  1146.                         record  which  matches  the  search condition.
  1147.  
  1148.             Syntax
  1149.                         Locate(FieldNo  : BYTE;SearchStr  : String)  :
  1150.                         BOOLEAN;
  1151.  
  1152.             ************************
  1153.  
  1154.             LookUp procedure
  1155.  
  1156.             Function
  1157.  
  1158.                        Searches for a key string in an index, and sets
  1159.                        the record pointer at the record containing the
  1160.                        closest match.
  1161.  
  1162.            Syntax
  1163.  
  1164.                        LookUp(SearchStr : string;NdxID: BYTE);
  1165.  
  1166.            ************************
  1167.  
  1168.             Lower function
  1169.  
  1170.             Function
  1171.  
  1172.                         Converts a string to lower case.
  1173.  
  1174.             Syntax
  1175.  
  1176.                         Lower(InStr: String):  String; Externally
  1177.                         declared in Flash.obj.
  1178.  
  1179.             *************************
  1180.  
  1181.             MakeDBIndex procedure
  1182.  
  1183.             Function
  1184.  
  1185.                         Creates  a new  index file  but does  not
  1186.                         build it.
  1187.  
  1188.             Syntax
  1189.                         MakeDBIndex(NdxID    :    BYTE;DBIndexName   :
  1190.                               FileName;KeyLen,Status : Integer);
  1191.  
  1192.             Remarks
  1193.  
  1194.                         DBIndexName can be a  maximum of 66 chars
  1195.                         in length  and is the full  path and name
  1196.                         of the index file  to be created. the key
  1197.                         field.
  1198.  
  1199.                         KeyLen  is the  length of  the key field.
  1200.                         Number  are  stored  as  strings  in .DBF
  1201.                         files,  and  can  thus  be  used  as keys
  1202.                         without conversion.
  1203.  
  1204.                         Status   is   defined   as   one  of  two
  1205.                         constants:  NoDuplicates,  or Duplicates,
  1206.                         according  to  whether  or  not duplicate
  1207.                         keys will be allowed in the index.
  1208.  
  1209.  
  1210.             ************************
  1211.  
  1212.             Mark procedure
  1213.  
  1214.             Function
  1215.  
  1216.                         Marks the current record for deletion.
  1217.  
  1218.             Syntax
  1219.  
  1220.                         Mark;
  1221.  
  1222.  
  1223.             ************************
  1224.  
  1225.             Max function
  1226.  
  1227.             Function
  1228.  
  1229.                         Determines the maximum of two integers
  1230.  
  1231.             Syntax
  1232.  
  1233.                         Max(N1,N2 : Integer) : Integer;
  1234.  
  1235.             *************************
  1236.  
  1237.             Min function
  1238.  
  1239.             Function
  1240.  
  1241.                         Determines the minimum of two integers
  1242.  
  1243.             Syntax
  1244.  
  1245.                         Min(N1,N2 : Integer) : Integer;
  1246.  
  1247.             *************************
  1248.  
  1249.             Mon function
  1250.  
  1251.             Function
  1252.  
  1253.                         Returns numeric value for  the month in a
  1254.                         date.
  1255.  
  1256.             Syntax
  1257.  
  1258.                         Mon(InDate : DateStr) : Byte;
  1259.  
  1260.             *************************
  1261.  
  1262.             Mul function
  1263.  
  1264.             Function
  1265.  
  1266.                         Multiplies two numeric fields.
  1267.  
  1268.             Syntax
  1269.  
  1270.                         Mul(Field1,Field2 : Byte):string;
  1271.  
  1272.             Remarks
  1273.  
  1274.                         Field1 and  Field2 are the  order numbers
  1275.                         of the  respective fields as  they appear
  1276.                         in the .DBF structure.
  1277.  
  1278.             *************************
  1279.  
  1280.             NewDBRec procedure
  1281.  
  1282.             Function
  1283.  
  1284.                         Creates  a  new  blank  record in memory,
  1285.                         ready for editing.
  1286.  
  1287.             Syntax
  1288.  
  1289.                         NewDBRec;
  1290.  
  1291.             ************************
  1292.  
  1293.             NextDBKey procedure
  1294.  
  1295.             Function
  1296.  
  1297.                         Moves file  record pointer to  the record
  1298.                         number associated with the next key in an
  1299.                         index.
  1300.  
  1301.             Syntax
  1302.  
  1303.                         NextDBKey(NdxID : BYTE;KeyStr : DBKey);
  1304.  
  1305.             Remarks
  1306.  
  1307.                          See    documentation     for    AddDBKey
  1308.                          procedure.
  1309.  
  1310.  
  1311.             ************************
  1312.  
  1313.             NextRec procedure
  1314.  
  1315.             Function
  1316.  
  1317.                         Moves  the  file   pointer  to  the  next
  1318.                         sequential record in the file.
  1319.  
  1320.             Syntax
  1321.  
  1322.                         NextRec;
  1323.  
  1324.             ************************
  1325.  
  1326.             OpenDBIndex procedure
  1327.  
  1328.             Function
  1329.  
  1330.                         Opens an index for search and updating.
  1331.  
  1332.             Syntax
  1333.  
  1334.                         OpenDBIndex(NdxID    :    BYTE;DBIndexName   :
  1335.                         FileName;KeyLen,Status : Integer);
  1336.  
  1337.             Remarks
  1338.  
  1339.                         DBIndexName can be a  maximum of 66 chars
  1340.                         in length  and is the full  path and name
  1341.                         of the index file  to be created. the key
  1342.                         field.
  1343.  
  1344.                         KeyLen  is the  length of  the key field.
  1345.                         Number  are  stored  as  strings  in .DBF
  1346.                         files,  and  can  thus  be  used  as keys
  1347.                         without conversion.
  1348.  
  1349.                         Status   is   defined   as   one  of  two
  1350.                         constants:  NoDuplicates,  or Duplicates,
  1351.                         according  to  whether  or  not duplicate
  1352.                         keys will be allowed in the index.
  1353.  
  1354.  
  1355.             ************************
  1356.  
  1357.             Pack procedure
  1358.  
  1359.             Function
  1360.  
  1361.                         Packs  a  .DBF  files,  removing  records
  1362.                         marked   for  deletion.   Pack  does   an
  1363.                         in-place  pack,  without  using temporary
  1364.                         files.
  1365.  
  1366.             Syntax
  1367.  
  1368.                         Pack;
  1369.  
  1370.             ************************
  1371.  
  1372.             PadL function
  1373.  
  1374.             Function
  1375.  
  1376.                         Pads a string with spaces on the left, to
  1377.                         a specified field length.
  1378.  
  1379.             Syntax
  1380.  
  1381.                         PadL(InStr:      String;     FieldLength:
  1382.                         Integer): String;
  1383.  
  1384.             ************************
  1385.  
  1386.             PadR function
  1387.  
  1388.             Function
  1389.  
  1390.                         Pads a  string with spaces  on the right,
  1391.                         to a specified field length.
  1392.  
  1393.             Syntax
  1394.  
  1395.                         PadR(InStr:      String;     FieldLength:
  1396.                         Integer): String;
  1397.  
  1398.  
  1399.             ************************
  1400.  
  1401.             PrevDBKey procedure
  1402.  
  1403.             Function
  1404.  
  1405.                         Moves file  pointer to the  record number
  1406.                         corresponding to  the previous key  in an
  1407.                         index.
  1408.  
  1409.             Syntax
  1410.  
  1411.                         PrevDBKey(NdxID : BYTE;KeyStr : DBKey);
  1412.  
  1413.             Remarks
  1414.  
  1415.                         See documentation for AddDBKey procedure.
  1416.  
  1417.  
  1418.             ************************
  1419.  
  1420.             PrevRec procedure
  1421.  
  1422.             Function
  1423.  
  1424.                         Moves  the file  pointer to  the previous
  1425.                         sequemtial record in the file.
  1426.  
  1427.             Syntax
  1428.  
  1429.                         PrevRec;
  1430.  
  1431.             ************************
  1432.  
  1433.             Prompt procedure
  1434.  
  1435.             Function
  1436.  
  1437.                         Displays a  prompt string at  a specified
  1438.                         row an column, using direct video writes.
  1439.  
  1440.             Syntax
  1441.  
  1442.                         Prompt(Row,Col : Byte;PromptStr : Str80);
  1443.  
  1444.             ************************
  1445.  
  1446.             PutDBRec procedure
  1447.  
  1448.             Function
  1449.  
  1450.                         Writes  the current  editing record  to a
  1451.                         specified record number in the .DBF file.
  1452.  
  1453.             Syntax
  1454.  
  1455.                         PutDBRec(RecordNumber : LongInt);
  1456.  
  1457.             Remarks
  1458.  
  1459.                         Be sure that  the specified record number
  1460.                         is the same as the  one given in the call
  1461.                         to GetDBRec.
  1462.  
  1463.             ************************
  1464.  
  1465.  
  1466.             ReadDBHeader procedure
  1467.  
  1468.             Function
  1469.  
  1470.                         Reads the file header of a .DBF file into
  1471.                         a buffer.
  1472.  
  1473.             Syntax
  1474.  
  1475.                         ReadDBHeader;
  1476.  
  1477.             ************************
  1478.  
  1479.             Recall procedure
  1480.  
  1481.             Function
  1482.  
  1483.                         Unmarks  a record  previously marked  for
  1484.                         deletion.
  1485.  
  1486.             Syntax
  1487.  
  1488.                         Recall;
  1489.  
  1490.             ************************
  1491.  
  1492.             Repl procedure
  1493.  
  1494.             Function
  1495.  
  1496.                         Replaces  a specified  field in  a record
  1497.                         with a specified string.
  1498.  
  1499.             Syntax
  1500.  
  1501.                         Repl(FieldNumber    :    Byte;ReplStr   :
  1502.                         string);
  1503.  
  1504.             Remarks
  1505.  
  1506.                         FieldNumber is the number of the field in
  1507.                         the .DBF  file structure. ReplStr  is the
  1508.                         string  with  which  the  field  is to be
  1509.                         replaced.  When  replacing  date  fields,
  1510.                         remember that the date  string must be in
  1511.                         the form "19910214".
  1512.  
  1513.             ************************
  1514.  
  1515.             ReplEach procedure
  1516.  
  1517.             Function
  1518.  
  1519.                         Replaces a specified field in each record
  1520.                         in a .DBF file with a specified string.
  1521.  
  1522.             Syntax
  1523.  
  1524.                         ReplEach(FieldNumber  :   Byte;ReplStr  :
  1525.                         String);
  1526.  
  1527.             Remarks
  1528.  
  1529.                         FieldNumber is the number of the field in
  1530.                         the .DBF  file structure. ReplStr  is the
  1531.                         string  with  which  the  field  is to be
  1532.                         replaced.  When  replacing  date  fields,
  1533.                         remember that the date  string must be in
  1534.                         the form "19910214".
  1535.  
  1536.             ************************
  1537.  
  1538.             Replicate function
  1539.  
  1540.             Function
  1541.  
  1542.                         Fills a string with a specified number of
  1543.                         a specified character.
  1544.  
  1545.             Syntax
  1546.  
  1547.                         Replicate(Ch  :  Char;Count   :  word)  :
  1548.                         String; Externally declared in Flash.obj.
  1549.  
  1550.             ************************
  1551.  
  1552.             RTrim function
  1553.  
  1554.             Function
  1555.  
  1556.                         Trims trailing blanks from a string.
  1557.  
  1558.             Syntax
  1559.  
  1560.                         RTrim(InStr: String): String;
  1561.  
  1562.             ************************
  1563.  
  1564.             Save procedure
  1565.  
  1566.             Function
  1567.  
  1568.                         Writes the current record to disk.
  1569.  
  1570.  
  1571.             Syntax
  1572.  
  1573.                         Save;
  1574.  
  1575.             ***********************
  1576.  
  1577.             Say procedure
  1578.  
  1579.             Function
  1580.  
  1581.                         Displays   a   particular   field   at  a
  1582.                         specified row and column.
  1583.  
  1584.             Syntax
  1585.  
  1586.                         Say(FieldNumber,Row,Col : Byte);
  1587.  
  1588.             Remarks
  1589.  
  1590.                         FieldNumber is the  position of the field
  1591.                         in the .DBF file structure.
  1592.  
  1593.             ************************
  1594.  
  1595.             SetDBColor
  1596.  
  1597.             Function
  1598.  
  1599.                         Sets  foreground   and  background  color
  1600.                         before a call to ClrScr.
  1601.  
  1602.             Syntax
  1603.  
  1604.                         SetDBColor(FG,BG : Byte);
  1605.  
  1606.             ************************
  1607.  
  1608.             SetDateFormat procedure
  1609.  
  1610.             Function
  1611.  
  1612.                         Sets date format to  one of the following
  1613.                         constants:
  1614.  
  1615.                         French   = 1; {dd/mm/yy}
  1616.                         German   = 2; {dd.mm.yy}
  1617.                         Italian  = 3; {dd-mm-yy}
  1618.                         American = 4; {mm/dd/yy}
  1619.                         British  = 5; {dd/mm/yy}
  1620.                         Ansi     = 99;{yy.mm.dd}
  1621.  
  1622.             Syntax
  1623.                         SetDateFormat(Format : Byte);
  1624.  
  1625.             Example
  1626.  
  1627.                         SetDateFormat(Ansi);
  1628.  
  1629.             ************************
  1630.  
  1631.             SetIndexTo procedure
  1632.  
  1633.             Function
  1634.                         Selects a specified index in the array of
  1635.                         currently open indexes.
  1636.  
  1637.             Syntax
  1638.  
  1639.                         SetIndexTo(NdxID : Byte);
  1640.  
  1641.             Example
  1642.                         See the sample program INDXDEMO.PAS.
  1643.  
  1644.             ************************
  1645.  
  1646.             ShowStatus procedure
  1647.  
  1648.             Function
  1649.  
  1650.                         Displays  status  of  .DBF  file, after a
  1651.                         call to ReadDBHeader.
  1652.  
  1653.             Syntax
  1654.  
  1655.                         ShowStatus;
  1656.  
  1657.             ************************
  1658.  
  1659.             Skip procedure
  1660.  
  1661.             Function
  1662.  
  1663.                         Skips a specified number  of records in a
  1664.                         DBF, either in indexed or natural order.
  1665.  
  1666.             Syntax
  1667.  
  1668.                         Skip(NumRecs : Longint);
  1669.  
  1670.             Example
  1671.                         See the sample program INDXDEMO.PAS.
  1672.  
  1673.             ************************
  1674.  
  1675.             SortOn procedure
  1676.  
  1677.             Function
  1678.  
  1679.                       Sorts a  DBF file to another  DBF, on a key
  1680.                       string expression  of up to  254 characters
  1681.                       in length.
  1682.  
  1683.                       See   SortDemo.pas  and   TPDBSort.pas  for
  1684.                       syntax and explanation.
  1685.  
  1686.             ***********************
  1687.  
  1688.             Sub function
  1689.  
  1690.             Function
  1691.  
  1692.                         Subtracts two numeric  fields - field2 is
  1693.                         subtracted FROM field1.
  1694.  
  1695.             Syntax
  1696.  
  1697.                         Sub(Field1,Field2 : Byte) : string;
  1698.  
  1699.             Remarks
  1700.  
  1701.                         Field1 and  Field2 are the  order numbers
  1702.                         of the  respective fields as  they appear
  1703.                         in the .DBF structure.
  1704.  
  1705.             *************************
  1706.  
  1707.             Sum function
  1708.  
  1709.             Function
  1710.  
  1711.                         Sums a numeric field  in all records in a
  1712.                         .DBF file.
  1713.  
  1714.             Syntax
  1715.  
  1716.                         Sum(FNo : Byte) : Real;
  1717.  
  1718.  
  1719.  
  1720.             ************************
  1721.  
  1722.             TimeNow function
  1723.  
  1724.             Function
  1725.  
  1726.                         Returns current time in formatted string.
  1727.  
  1728.             Syntax
  1729.  
  1730.                         TimeNow : TimeStr;
  1731.  
  1732.             *************************
  1733.  
  1734.             Today function
  1735.  
  1736.             Function
  1737.  
  1738.                         Returns current  date in .DBF  date field
  1739.                         compatible format.
  1740.  
  1741.             Syntax
  1742.  
  1743.                         Today : DateStr;
  1744.  
  1745.             *************************
  1746.  
  1747.             Upper function
  1748.  
  1749.             Function
  1750.  
  1751.                         Converts a string to upper case.
  1752.  
  1753.             Syntax
  1754.  
  1755.                         Upper(InStr:  String):  String; Externall
  1756.                         declared in Flash.obj.
  1757.  
  1758.             ************************
  1759.  
  1760.             ValidDate function
  1761.  
  1762.                         Checks  whether  a  date  is  valid,  and
  1763.                         returns True or False.
  1764.  
  1765.             Syntax
  1766.  
  1767.                         ValidDate(InDate : DateStr): boolean;
  1768.  
  1769.             *************************
  1770.  
  1771.             Wait procedure
  1772.  
  1773.             Function
  1774.  
  1775.                         Displays  a  prompt,  'Press  any  key to
  1776.                         continue...', and waits for a key press.
  1777.  
  1778.             Syntax
  1779.  
  1780.                         Wait;
  1781.  
  1782.             ************************
  1783.  
  1784.             WriteDBHeader procedure
  1785.  
  1786.             Function
  1787.  
  1788.                         Updates a .DBF file header.
  1789.  
  1790.             Syntax
  1791.  
  1792.                         WriteDBHeader;
  1793.  
  1794.  
  1795.             ************************
  1796.  
  1797.             Zap procedure
  1798.  
  1799.             Function
  1800.  
  1801.                         Deletes all records in a .DBF file.
  1802.  
  1803.             Syntax
  1804.  
  1805.                         Zap;
  1806.  
  1807.             Remarks
  1808.  
  1809.                         CAREFUL  !  This  procedure  really  does
  1810.                         remove all  records, completely rewriting
  1811.                         the file.
  1812.  
  1813.             ************************
  1814.  
  1815.             (**** Revision History ****)
  1816.  
  1817.             2/7/89 - Version 1.0 released
  1818.  
  1819.             2/8/89  - Version  1.1 -  fixed bug  in numeric input
  1820.             that caused truncation  of integers. Also, recompiled
  1821.             in  $N-,$E+  state  to  allow  for  8087 emulation on
  1822.             non-8087  machines.   Fixed  range  error   in  array
  1823.             indexing.
  1824.  
  1825.             Renamed unit TPDB10.tpu  to TPDB.tpu. Future versions
  1826.             will retain this name.
  1827.  
  1828.             2/10/89 - Version 1.2 - Modified indexing routines to
  1829.             allow for index keys up to 254 characters.
  1830.  
  1831.                 Added  boolean  variable,   UCKey,  which  allows
  1832.                 indexes to be created on upper case form of keys.
  1833.  
  1834.                 Added procedures Prompt and Upper.
  1835.  
  1836.                 Added procedures Flash, FlashC, and FlashFill.
  1837.  
  1838.                 Added CheckScreen procedure.
  1839.  
  1840.                 Expanded documentation and added demo files.
  1841.  
  1842.                 Temporarily  removed  source  code  from this doc
  1843.                 file  pending further  additions and  decision on
  1844.                 which source to include.
  1845.  
  1846.             2/14/89 - Version 1.3 - Added TPDB error handler.
  1847.  
  1848.                 Improved documentation.
  1849.  
  1850.                 Fixed bug in Display procedure.
  1851.  
  1852.                 Added Sum  and Field functions,  NextRec and
  1853.                 PrevRec procedures.
  1854.  
  1855.                 Added BOF and EOF functions.
  1856.  
  1857.                 Added PrevDBKey and NextDBKey procedures.
  1858.  
  1859.                 Added Repl and ReplEach procedures.
  1860.  
  1861.                 Added FillRecs procedure.
  1862.  
  1863.  
  1864.             2/22/89 - Version 2.0 - Modified indexing routines to
  1865.             allow key  expressions which evaluate to  a string to
  1866.             be passed to the indexing routines.
  1867.  
  1868.             Improved documentation.
  1869.  
  1870.             Added  new   assembler  string  and   video  handling
  1871.             procedures.
  1872.  
  1873.             Added source for TPDB.tpu.
  1874.  
  1875.             Added  TPDBDate.tpu  -  date  handling routines, with
  1876.             source.
  1877.  
  1878.             Added  TPDBMath.tpu  -  mathematical  functions, with
  1879.             source.
  1880.  
  1881.             Because of significant revisions and additions to the
  1882.             original  source,  released  this  version as version
  1883.             2.0.
  1884.  
  1885.             2/23/89 -  Version 2.1 - fixed  bug in array indexing
  1886.             in Display and Field procedures.
  1887.  
  1888.             3/1/89 -  Version 2.2 - modified  Repl and Field
  1889.             procedures to use Move procedure. Added TPDBHigh.pas,
  1890.             a unit  of high level  calls. Documentation for  high
  1891.             level  calls  is  contained  within  the source code.
  1892.  
  1893.             8/3/89  -  Version  3.0  -  Converted  to  object-oriented
  1894.             version. The number of DBF files  and NDX files per DBF is
  1895.             limited now only by the amount of available memory and the
  1896.             DOS  version in  use.  Procedures  and functions  added as
  1897.             documented above.
  1898.  
  1899.             8/19/89 - Version 3.1 -
  1900.  
  1901.             - Procedure SetColor changed to SetDBColor to prevent conflicts
  1902.               when the Graph unit is used.
  1903.  
  1904.             - Procedure  SetDateFormat was added to  allow use of
  1905.               foreign date formats.
  1906.  
  1907.               Supported date formats are as follows:
  1908.               CONST
  1909.               French   = 1; {dd/mm/yy}
  1910.               German   = 2; {dd.mm.yy}
  1911.               Italian  = 3; {dd-mm-yy}
  1912.               American = 4; {mm/dd/yy}
  1913.               British  = 5; {dd/mm/yy}
  1914.               Ansi     = 99;{yy.mm.dd}
  1915.  
  1916.            -  Added  procedures  ChAttr  and  ChAllAttr to change
  1917.               displayed screen  attributes.
  1918.  
  1919.            -  Added TPDBSort.tpu, containing Procedure SortOn.
  1920.  
  1921.            -  Added BinSearch routine, for searching sorted files of
  1922.               unique keys.
  1923.  
  1924.            - Version  3.11 - September,  1989 - moved  all string
  1925.              handling  functions into  TPDBStr.pas. Moved  most screen
  1926.              handling functions into TPDBScrn.pas.
  1927.  
  1928.            - Versions 3.12 - 3.16 - Minor maintenance releases
  1929.  
  1930.            - Version 3.20 - October, 1991 - changes to indexing scheme and
  1931.              Skip procedure and addition of SetIndexTo procedure.
  1932.  
  1933.             ********************************************************
  1934.                     End  of Documentation  - TPDB  Version 3.20
  1935.                               Copyright 1991 Brian Corll
  1936.             ********************************************************
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.