FATS - Fast Access Tree System
Table of Contents
Programming Interfaces
Turbo Pascal, Borland Pascal for DOS

Turbo Pascal, Borland Pascal for DOS


 
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.tpuTurbo-Pascal Unit (compiled with Turbo-Pascal 6.0)
fats_tp.pasUnit sourcecode
fatstp.objFATS object file
fatsctpu.obj"

The unit FATS_TPR.TPU is included on the distribution diskette to call the FATS Workstation Engine:

fats_tpr.tpuTurbo-Pascal Unit (compiled with Turbo-Pascal 6.0)
fats_tpr.pasUnit sourcecode
fatstpr.objCalling 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:

szCmndCommand string (input)
nErrorcodeErrorcode (output)
szFatsKeyKey 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.pasTest program for Turbo-Pascal
tst1_bpe.pasProtected Mode test program
 rebuild.pasRe-Indexing a Data File (commands 'BK', 'DL')

The extended version of FATS contains the following additional test programs:

 tst2_tpe.pasIntroduction to the Matchcode Functions
tst2_bpe.pasProtected Mode test program
 mcsort.pasUse of the key-flag with command 'MC'
 reindex.pasFast Re-Indexing with the command 'XB'


 

© 2008  GCS Software, Udo Gertz