FATS - Fast Access Tree System
Table of Contents
Programming Interfaces
Borland Pascal for DOS (Protected Mode)

Borland Pascal for DOS (Protected Mode)


 
Libraries FATS_BP.DLL / FATSXBP.DLL

The diskette FATS for PC-DOS/MS-DOS contains the dynamic link libraries FATS_BP.DLL (basis version) resp. FATSXBP.DLL (extended version) to provide FATS access in protected mode applications. If you choose to use FATS with real mode programs you have to use the units FATS_TP.TPU resp. FATSXTPR.TPU.The libraries are exporting the following functions:

function FATSDLLInit(uDatasize: word): Pointer; external 'FATS_BP';

function FATSDLLCall(var szCmnd: string; var nErrorcode: Word; var szFatsKey: string; lpFatsdata: Pointer): longint; external 'FATS_BP';

function FATSDLLExit(lpFatsdata: Pointer): Pointer; external 'FATS_BP';

Before you can use the FATS commands in your Borland-Pascal program, you must assign a data area to FATS:

begin
{ -------> init fats datasegment }

lpFatsdata:=FATSDLLInit( 0 );

Before terminating the application program you should release the storage area allocated by FATSDLLInit. You can do this by calling the function FATSDLLExit:

lpFatsdata:=FATSDLLExit(lpFatsdata);

Although the storage area would be released automatically by the operating system, this instruction is useful, since it closes all FATS files that are still opened.

 
Calling FATS

FATS commands are executed with the function FATSDLLCall:

dwRecno := FATSDLLCall(szCmnd, nErrorcode, szFatsKey, lpFatsdata);

Parameter Usage:

szCmndCommand string (input)
nErrorcodeErrorcode (output)
szFatsKeyKey value (output)
lpFatsdataAddress of FATS data area (input)
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_bpe.pasTest program (Protected Mode)
rebuild.pasRe-Indexing a Data File (commands 'BK', 'DL')

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

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


 

© 2008  GCS Software, Udo Gertz