FATS - Fast Access Tree System
Table of Contents
Programming Interfaces
MS-Basic, Quick Basic Compiler

MS-Basic, Quick Basic Compiler


 
Needed Object Files

Up to version 6.0 of the basic compiler all strings were administered in the data segment of the application. Starting from the version 7.0 the entire memory can be used by strings (compiler flag /Fs).

Therefore you must use the appropriate interface when linking with FATS.
To link FATS to your programs you will need the following object modules:

fats.objThe FATS module for MS-DOS
fats_mb6.objMS-Basic interface for NEAR-strings, *or*
fats_mb7.objMS-Basic interface for FAR-strings (/Fs)

The following libraries are included on the distribution diskette to call the FATS Workstation Engine:

fatsmb6r.libinterface for NEAR-strings, *or*
fatsmb7r.libinterface for FAR-strings (/Fs)

If you want to make calls to the extended version of FATS (FATSXWE.EXE), you have to use the libraries fatsxb6r.lib or fatsxb7r.lib.

If you like to use the resident module FATS.COM to make the FATS calls, the object module fatsmb7t.obj provides the FABS PLUS compatible function FABSMB2.

 
Linking a MS Basic Program with FATS

To compile and link a application that calls FATS, use ONE of the following methods:

1. METHOD: Linking FATS to the program

BC tst1eng6 /Lr
LINK tst1eng6 fats.obj fats_mb6;

or Basic 7.x and FAR-strings:

BC tst1eng7 /Lr /Fs;
LINK tst1eng7 fats fats_mb7;

2. METHOD: Calling the Workstation Engine (FATS_WE.EXE)

BC tst1eng7 /Lr [/Fs]
LINK tst1eng7 fatsmb[6 or 7]r.lib;

or if you own the extended version of FATS: (FATSXWE.EXE)

LINK tst1eng7 fatsxb[6 or 7]r.lib;

 
Calling FATS

FATS commands are executed with the function FATSBASIC :

CALL FATSBASIC(CMND$, ERRORCODE%, RECNO&, KEYLEN%)

Parameter Usage:

CMND$Command string (input)
ERRORCODE%Errorcode (output), integer
RECNO&Record number (output), long integer
KEYLEN%Length of key value (output), integer

To call FATS, you will need the following subroutine in your program:

FATSCALL:
CALL FATSBASIC(CMND$, ERRORCODE%, RECNO&, KEYLEN%)
FATSKEY$ = SPACE$(KEYLEN%)
CALL FATSGETKEY( FATSKEY$ )
RETURN

The FATSBASIC subroutine does the actual call to FATS and returnes the length of a found key in the KEYLEN% variable. This value should be used to assign to the key string variable the value SPACE$(KEYLEN%). Until your application assigns some value to the string variable, it has a length of 0.
The FATSGETKEY subroutine copies the key value from the previous FATS call to the key string variable.

 
Testprograms

The FATS distribution disk for PC-DOS/MS-DOS contains some test programs in the directory DOS_16I\BASIC\MS that illustrate how you can use the FATS commands in your programs:

 tst0eng6.basMS-Basic (uses FABSMB)
 tst0eng7.basMS-Basic Version 7.0 (uses FABSMB3)
 tst1eng6.basMS-Basic (uses FATSBASIC)
 tst1eng7.basMS-Basic Version 7.0 (uses FATSBASIC)
 rebuild.basRe-Indexing a Data File (commands 'BK', 'DL')

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

 tst2_eng.basIntroduction to the Matchcode Functions
 mcsort.basUse of the key-flag with command 'MC'
 reindex.basFast Re-Indexing with the command 'XB'

 
Compatible Programming Interfaces

You also can use the interfaces provided by the FABS PLUS modules. Please take notice of the additional information at pages  4-77, 9-77 and 9-77.

The following FABS interfaces are available:

FABSMBEntry point in FATS.OBJ (near-strings)
FABSMB2Calling the resident version FATS.COM
(object file FATSMB7T.OBJ)
FABSMB3like FABSMB, however for Basic ver.7
(object file FATS_MB7.OBJ)


 

© 2008  GCS Software, Udo Gertz