|
Unit FATS_TP
The integration of the FATS module occurs in form of a Turbo Pascal unit (Real-Mode) or Borland Pascal Dynamic Link Library (Protected Mode). The FATS distribution disk for PC-DOS/MS-DOS contains the unit‘s source code in the directory DOS_16I\PASCAL\BORLAND:
fats.tpu Turbo-Pascal Unit (compiled with Turbo-Pascal 6.0) fats_tp.pas Unit sourcecode fatstp.obj FATS object file fatsctpu.obj "
The unit FATS_TPR.TPU is included on the distribution diskette to call the FATS Workstation Engine:
fats_tpr.tpu Turbo-Pascal Unit (compiled with Turbo-Pascal 6.0) fats_tpr.pas Unit sourcecode fatstpr.obj Calling the Engine
If you want to make calls to the extended version of FATS (FATSXWE.EXE), you have to use the unit fatsxtpr.tpu instead of fats_tpr.tpu.
You translate the unit with the following command:
TPC FATS_TPresp.TPC FATS_TPR (Workstation Engine / Basis Version)TPC FATSXTPR (Workstation Engine / Extended Version)
The unit FATS_TP exports the functions FATSCALL & FATSINIT:
function FATSINIT(size:Word):Boolean;function FATSCALL(var szCmnd:string; var nErrorcode: word; var szFatsKey:string): longint;
Before you can use the FATS commands in your Turbo-Pascal program, you must assign a data area to FATS:
begin
{ -------> init fats datasegment }
if not FATSINIT(20000) then exit;
The above instruction reserves 20000 bytes in the Turbo Pascal heap segment for the use by FATS.
Compiling the Turbo Pascal Program
You translate the test program as follows:
TPC TST1_TPE
Calling FATS
FATS commands are executed with the function FATSCALL:
dwRecno :=fatscall(szCmnd, nErrorcode, szFatsKey);
Parameter Usage:
szCmnd Command string (input) nErrorcode Errorcode (output) szFatsKey Key value (output) Return Value: Record Number
Testprograms
The FATS distribution disk for PC-DOS/MS-DOS contains some test programs in the directory DOS_16I\PASCAL\BORLAND that illustrate how you can use the FATS commands in your programs:
tst1_tpe.pas Test program for Turbo-Pascal tst1_bpe.pas Protected Mode test program rebuild.pas Re-Indexing a Data File (commands 'BK', 'DL')
The extended version of FATS contains the following additional test programs:
tst2_tpe.pas Introduction to the Matchcode Functions tst2_bpe.pas Protected Mode test program mcsort.pas Use of the key-flag with command 'MC' reindex.pas Fast Re-Indexing with the command 'XB'
© 2008 GCS Software, Udo Gertz