home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TPDB30.ZIP / TPDB.DOC < prev    next >
Encoding:
Text File  |  1989-08-03  |  38.6 KB  |  1,846 lines

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