Category : Pascal Source Code
Archive   : TBXFIX.ZIP
Filename : TOOLBOX.FIX

 
Output of file : TOOLBOX.FIX contained in archive : TBXFIX.ZIP

*******************************************************************************
TBXFIX
Version 1.2
February 9, 1986
by Randy Forgaard [70307,521]
Original version by:
Larry Kraft [76703,764]
Bela Lubkin [76703,3015]
This file describes all changes and bug fixes that Borland has made to
the Turbo Database Toolbox (formerly Turbo Toolbox), from the original
Version 1.0 of the Toolbox up through Version 1.2, plus some additional
fixes that were not included in Version 1.2. These changes apply to the
Toolbox versions for all operating systems, except where noted. The
Toolbox is provided in source code form (except GINST), so you can make
these changes directly to the source code to update your copy of the
Toolbox. Since these are all the known changes, and the GINST files
have been identical in all versions of the Toolbox, it should not be
necessary for you to return your copy of the Toolbox for an updated
copy. You can perform the "upgrade" yourself.
Change Log:
Version 1.1: (Also known as Version B.) Included all changes between
Version 1.00 and Version 1.01/1.1 of the Toolbox.
Version 1.2: Included all additional changes that were made to Version
1.2 of the Toolbox, plus some additional fixes.
*******************************************************************************
If you discover any errors or omissions in this file, or if future
versions of the Turbo Database Toolbox incorporate changes not mentioned
here, please send an EasyPlex message to Randy Forgaard [70307,521], or
feel free to make the changes yourself and upload the new version of
this file.
Between bug fixes and new versions of Turbo Pascal itself, the Turbo
Database Toolbox has had a rather confusing lineage of versions.
However, it has not substantively changed since its original
introduction. The first version, introduced in the Fall of 1984, was
known as Turbo Toolbox 1.00. A few bugs were found and fixed, and a new
Version 1.01 appeared in early 1985.
Meanwhile, Turbo Pascal 3.0 was released in the Spring of 1985, and with
it a new internal file format for DOS versions of Turbo. The necessary
Turbo Toolbox modifications, for use with DOS Turbo 3.0, were included
on the new DOS Turbo 3.0 distribution disk under the name ACCESS3.BOX.
This file carried the moniker of "Version 3.00" in its header, even
though the then-current versions of all other Toolbox files were still
identified as Version 1.01. ACCESS3.BOX included all of the changes
that were made to ACCESS.BOX in Toolbox 1.01, but anyone who had not
updated to 1.01 still had the old versions of the other *.BOX files.
Sometime during 1985, Borland switched to using one digit, instead of
two, after the decimal point in the version numbers for the Toolbox.
Consequently, Version 1.01 was effectively renamed to Version 1.1, with
apparently no change in content.
In late 1985, Borland rewrote the Toolbox manual, and renamed the
product to be Turbo Database Toobox, to distinguish it from the Turbo
Graphix Toolbox and Turbo Editor Toolbox which had since been
introduced. In conjunction with the new manual and name change, Borland
released a new Version 1.2 of the Database Toolbox. Version 1.2 differs
from 1.01/1.1 in that better error handling was added in two places, a
simpler Turbo Access example program was included (in addition to the
original BTREE program), the user interfaces of the Turbo Sort example
programs were enhanced, and an incorrect fix was made to an outstanding
bug in the DOS edition of Toolbox Version 1.01/1.1. The original manual
(green and orange) still applies to Version 1.2 of the Toolbox. The new
manual (black and high-tech) has a nicer design, has more examples, and
is generally more "user-friendly."
With Version 1.2 of the Toolbox for DOS, Borland slightly changed its
strategy for handling the two editions of ACCESS.BOX (one for DOS Turbo
2.0, and one for DOS Turbo 3.0), since Turbo 3.0 is becoming firmly
entrenched and the Turbo 2.0 user is a vanishing breed. Prior to
Toolbox 1.2, ACCESS.BOX was for use with Turbo 2.0, and ACCESS3.BOX was
for use with Turbo 3.0. Now, on the Version 1.2 disk, ACCESS2.BOX is
for Turbo 2.0, and ACCESS.BOX is for 3.0. Borland provides a batch file
on the distribution disk that will rename these files so that
ACCESS2.BOX becomes ACCESS.BOX, for the benefit of Turbo 2.0 users. In
addition, ACCESS.BOX (formerly ACCESS3.BOX) now carries a Version 1.2 in
its header instead of 3.00, making it consistent with the other Toolbox
files. Unfortunately, ACCESS2.BOX incorrectly says "Version 1.1" in its
header, even though it has been upgraded and placed on the Version 1.2
distribution disk.
Wherever your Toolbox version resides in this ancestry, the information
below will tell you how to edit your Toolbox files to make them
identical to the most recent version of the Toolbox, including some
fixes that go beyond Version 1.2.
Version 1.2 includes a new program, called SETCONST.PAS, that can be
very helpful in choosing values for the constants (MaxDataRecSize,
PageSize, etc.) that Turbo Access requires. High recommended. This
program is available in DL 1 of the CompuServe Borland SIG under the
name SCONST.PAS.
In addition to the BTREE example that was supplied in earlier versions
of the Toolbox, Version 1.2 also includes a new example called
TBDEMO.PAS. TBDEMO is a simplified version of BTREE: only one IndexFile
is used (for customer codes), and most of the fancy screen handling has
been removed. It is also available in DL 1 of the Borland SIG, under
the same name.
In Version 1.2, the example programs SORT1.PAS and SORT2.PAS have a
nicer user interface than in Version 1.0/1.1. See TBSORT.LBR in DL 1 of
the Borland SIG for a libraried/squeezed version of the new SORT1.PAS,
SORT2.PAS, and their associated data files. Note: Neither the old
version nor the new version of SORT2.PAS will run correctly under the
8087 or BCD versions of Turbo Pascal (in particular, the "stock" listing
option of SORT2.PAS), because the "Price" field of ItemRec is a Real
field (which occupies more storage under the 8087 and BCD versions), and
the sample data files were created using the normal Turbo compiler.
There are also some other files in DL 1 of the Borland SIG that may be
of interest. These files describe how to modify the Database Toolbox to
extend it for various purposes; e.g., allowing more than 65535 records
per DataFile under DOS, enabling more than 15 Toolbox files to be open
simultaneously under DOS Turbo 3.0, and automatic "flushing" of
DataFiles and IndexFiles under DOS to guard against file corruption in
the event of a system crash. Try a "BRO/KEY:TOOLBOX" and a
"BRO/KEY:ACCESS" to find these and other files in DL 1.
Before making ANY of the changes below, be sure to make a working copy
of your Database Toolbox distribution disk, and make all of these
changes to the working copy ONLY. These changes are expressed in terms
of making changes to the Database Toolbox disk, for simplicity of
exposition, but please be sure that you are making the changes to your
working copy only, and not to the original Database Toolbox disk.
Important!
The changes below are numbered. None of the versions of the Toolbox
requires all of these changes; different versions require different
changes. For the purposes of the instructions below, determine which
version of the Toolbox you have by looking at the header comment at the
beginning of ADDKEY.BOX on your distribution disk. Using that version
number, use the following table to determine which of the 20 changes
below you need to make.
Toolbox Version # Operating System Which Changes to Make
----------------- ---------------- ---------------------
1.00 CP/M-80, CP/M-86 3, 6-12, 15-20
1.00 MS-DOS, PC-DOS 1-12, 14-20
1.01, 1.1 CP/M-80, CP/M-86 3, 6-8, 11-12, 18
1.01, 1.1 MS-DOS, PC-DOS 1-8, 11-12, 14, 18
1.2 CP/M-80, CP/M-86 18
1.2 MS-DOS, PC-DOS 5, 13-14, 18
IMPORTANT: If you have a pre-1.2 version of the Toolbox for DOS, it is
essential that you really do the file renaming described in Change #1,
below, BEFORE performing the other changes. Otherwise, when you make
the other changes, you will be modifying the wrong ACCESS.BOX file!
CHANGE #1 (Toolbox Versions 1.00, 1.01, and 1.1, DOS only):
If you are using some version of DOS Turbo 3.0: 1) Copy ACCESS3.BOX from
the Turbo Pascal 3.0 distribution disk to your Toolbox disk. 2) On the
Toolbox disk, rename the file ACCESS.BOX to ACCESS2.BOX. 3) Also on the
Toolbox disk, rename ACCESS3.BOX to ACCESS.BOX.
If you are using DOS but do not have Turbo 3.0, ignore all changes below
for ACCESS.BOX. Instead, for all changes indicated below for
ACCESS2.BOX, make >those< changes to your ACCESS.BOX file.
CHANGE #2 (Toolbox Versions 1.00, 1.01, and 1.1, DOS only):
The DOS edition of Version 1.2 of the Toolbox supplies a new batch file,
called TURBO2.BAT. This batch file contains many ECHO and PAUSE
statements that provide warnings against running the batch file unless
you are sure. The only executable DOS commands in TURBO2.BAT are the
following:
ren access.box access3.box
ren access2.box access.box
You may want to create TURBO2.BAT, with the above lines, for future
reference, if you have a pre-1.2 DOS version of the Toolbox. However,
you should ONLY actually run TURBO2.BAT if you will be using Turbo 2.0
instead of Turbo 3.0 with the Toolbox.
CHANGE #3 (Toolbox Versions 1.00, 1.01, and 1.1, all operating systems):
Replace the header in each of ADDKEY.BOX, GETKEY.BOX, and DELKEY.BOX
with the following. (Replace "ADDKEY," below, with "GETKEY" or "DELKEY"
as appropriate. Also, replace "MS-DOS, PC-DOS" with "CP/M-80" or
"CP/M-86," if appropriate.) In addition, if you have a CP/M-80 or
CP/M-86 version of the Toolbox, make this same header replacement in
ACCESS.BOX (with appropriate substitutions for "ADDKEY" and the
operating system).
(*********************************************************)
(* *)
(* TURBO-ACCESS for MS-DOS, PC-DOS *)
(* *)
(* Toolbox version: 1.2 *)
(* *)
(* DELKEY module *)
(* *)
(* Use with TURBO PASCAL 2.0 or later *)
(* *)
(* Copyright (C) 1984,85 by *)
(* Borland International *)
(* *)
(*********************************************************)
CHANGE #4 (Toolbox Versions 1.00, 1.01, and 1.1, DOS only):
Replace the header in ACCESS.BOX with the following (the "IMPORTANT:"
message below is part of the header in the file):
(*********************************************************)
(* *)
(* TURBO-ACCESS for MS-DOS, PC-DOS *)
(* *)
(* Toolbox version: 1.2 *)
(* *)
(* ACCESS module *)
(* *)
(* Use with TURBO PASCAL 3.0 or later *)
(* *)
(* Copyright (C) 1984,85 by *)
(* Borland International *)
(* *)
(*********************************************************)
(*
IMPORTANT:

Use this file, ACCESS.BOX, when compiling with TURBO 3.0.
Use ACCESS2.BOX when compiling with TURBO 2.0.
*)
CHANGE #5 (all Toolbox versions, DOS only):
Replace the header in ACCESS2.BOX with the following. Note: The header
in ACCESS2.BOX on the distribution disk for Toolbox Version 1.2 is
out-of-date. It reports the Toolbox version number as 1.1 instead of
1.2, includes a "Module version" number that has since been discarded,
and omits the "IMPORTANT:" line at the end of the header. These lines
have been corrected, below.
(*********************************************************)
(* *)
(* TURBO-ACCESS for MS-DOS, PC-DOS *)
(* *)
(* Toolbox version: 1.2 *)
(* *)
(* ACCESS module *)
(* *)
(* Use with TURBO PASCAL 2.0 only *)
(* *)
(* Copyright (C) 1984,85 by *)
(* Borland International *)
(* *)
(*********************************************************)
(*
IMPORTANT:

Use this file, ACCESS2.BOX, when compiling with TURBO 2.0.
Use ACCESS.BOX when compiling with TURBO 3.0.
*)
CHANGE #6 (Toolbox Versions 1.00, 1.01, and 1.1, all operating systems):
Replace the header in BTREE.PAS with the following:
(****************************************************************)
(* *)
(* TURBO-ACCESS Database Example *)
(* MODIFIED: 10/02/85 *)
(* *)
(* Copyright (C) 1984, 1985 by *)
(* Borland International *)
(* *)
(****************************************************************)
CHANGE #7 (Toolbox Versions 1.00, 1.01, and 1.1, all operating systems):
Add the following header to the beginning of BTREE.INC:
(****************************************************************)
(* *)
(* TURBO-ACCESS Database Example *)
(* MODIFIED: 10/02/85 *)
(* *)
(* - Include module - *)
(* *)
(* Copyright (C) 1984, 1985 by *)
(* Borland International *)
(* *)
(****************************************************************)
CHANGE #8 (Toolbox Versions 1.00, 1.01, and 1.1, all operating systems):
Add the following header to the beginning of SORT.BOX:
(***********************************************************)
(* *)
(* TURBO DATABASE TOOLBOX *)
(* *)
(* QuickSort module *)
(* Version 1.2 *)
(* *)
(* Copyright (C) 1984,85 by *)
(* Borland International *)
(* *)
(***********************************************************)
CHANGE #9 (Toolbox Version 1.00, all operating systems):
In ACCESS2.BOX, add the following line immediately after the "PutRec(...);"
statement in procedure CloseIndex:
Updated := false;
CHANGE #10 (Toolbox Version 1.00, all operating systems):
In ACCESS2.BOX, add the following two lines in two different places:
immediately after the "Assign(...);" statement in procedure MakeFile,
and also
immediately after the "Assign(...);" statement in procedure OpenFile.
IOstatus := IOresult;
TaIOcheck(DatF,0);
CHANGE #11 (Toolbox Versions 1.00, 1.01, 1.1, all operating systems):
In ACCESS2.BOX, add the following two lines in two different places:
immediately after the "Seek(...);" statement in procedure GetRec,
and also
immediately after the "Seek(...);" statement in procedure PutRec.
(Note: These two lines are NOT exactly the same as the additional lines
specified in Change #10!)
IOstatus := IOresult;
TaIOcheck(DatF,R);
CHANGE #12 (Toolbox Versions 1.00, 1.01, 1.1, all operating systems):
Use Change #11 (only), above, to modify ACCESS.BOX in exactly the same
manner as ACCESS2.BOX.
CHANGE #13 (Toolbox Version 1.2 ONLY, DOS only):
In ACCESS.BOX for DOS Toolbox Version 1.2, the declaration of the "Fil2"
field of the DataFile type appears as:
Fil2 : array[0..12] of Byte;
Replace this line with:
Fil2 : array[1..12] of Byte;
(Note: This error does not appear in pre-1.2 versions of the DOS
Toolbox.)
CHANGE #14 (all Toolbox versions, DOS only):
In ACCESS.BOX, in the TaIOcheck procedure, change the statement:
I := 0;
to:
I := 1;
CHANGE #15 (Toolbox Version 1.00, all operating systems):
In ADDKEY.BOX, in the very last three lines of the file, change:
end;
end;
end;
to:
end;
PP := 0;
end;
end;
CHANGE #16 (Toolbox Version 1.00, all operating systems):
In DELKEY.BOX, in the very last four lines of the file, change:
end;
end;
end;
end;
to:
end;
end;
PP := 0;
end;
end;
CHANGE #17 (Toolbox Version 1.00, all operating systems):
In SORT.BOX, about 17 lines after the main BEGIN of procedure QuickSort,
change:
M:=(I+J) Div 2;
to:
M:=(I+J) Shr 1;
(Note: This is not just for efficiency. The old "Div 2" version can
cause an arithmetic run-time error when sorting large files.)
CHANGE #18 (all Toolbox versions, all operating systems):
(Thanks to Scott Bussinger [72247,2671] for this fix.) When duplicate
keys are allowed in an IndexFile, the Toolbox manual states that
routines such as FindKey locate the first entry in the IndexFile having
that key. However, this is not necessarily true if there are more than
32767 records in the associated DataFile. Due to a bug in the
TaCompKeys function of ACCESS.BOX and ACCESS2.BOX, having to do with
signed vs. unsigned arithmetic, FindKey will locate the >second< of two
key entries having the same key, if the DataRef of the first key is less
than or equal to 32767, and the DataRef of the second key is greater
than 32767.
This does not have a great deal of practical significance. FindKey (and
the rest of the Toolbox) will all work consistently with the current
version of TaCompKeys; i.e., IndexFile entries having the same key will
always be found and returned in the same order, even though that order
may not proceed in the order that the associated data records are
physically stored in the DataFile. The physical order in the DataFile
is usually not important, however. For example, if you delete a record
using DeleteRec near the beginning of a DataFile, and later add a record
with AddRec, AddRec will reuse that deleted record location before
adding new records to the end of the DataFile.
Another caveat: If you do fix the TaCompKeys bug, you will need to
reconstruct all of your already-existing IndexFiles that allow duplicate
keys before attempting to access the IndexFiles with your applications,
to institute the new notion of TaCompKeys consistency into the
IndexFiles. If you do not reconstruct your IndexFiles after fixing
TaCompKeys, bizarre errors will result at run-time.
Taking the above into account, if you decide to correct the TaCompKeys
bug, replace the ENTIRE body of TaCompKeys (but keep the variable
declarations), in both ACCESS.BOX and ACCESS2.BOX, with the following
code:
begin
if Key1 = Key2 then
if (not Dup) or (DR1 = DR2) then TaCompKeys := 0
else if (DR1 + $8000) > (DR2 + $8000) then TaCompKeys := 1
else TaCompKeys := -1
else if Key1 > Key2 then TaCompKeys := 1
else TaCompKeys := -1
end;
CHANGE #19 (Toolbox Version 1.00, all operating systems):
The TurboSort function should not be used as a parameter to a WRITE or
WRITELN statement, as this may result in an illegal recursive call to
READ or WRITE. This is the reason behind both this change and Change
#20. Add the following variable declaration to the main VAR section of
both SORT1.PAS and SORT2.PAS on the Toolbox disk, and also on pages 71,
75, 78, and 82 of the original (green and orange) Turbo Toolbox manual
(if you have it).
Results : integer;
CHANGE #20 (Toolbox Version 1.00, all operating systems):
(See Change #19.) Throughout SORT1.PAS and SORT2.PAS, replace each
occurrence of the following line:
WriteLn(TurboSort(SizeOf(CustRec)));
with the following TWO lines:
Results:=TurboSort(SizeOf(CustRec));
WriteLn(Results);
There will be one occurrence of the above in SORT1.PAS, and two
occurrences in SORT2.PAS. Make this same change to pages 74, 76, 78
(two occurrences), and 84 (two occurrences) of the original (green and
orange) Turbo Toolbox manual (if you have it).
That's all!