FATS - Fast Access Tree System
Table of Contents
Programming Interfaces
Visual Basic for DOS

Visual Basic for DOS


 
Needed Object Files

To link FATS to your programs you will need the following object modules:

fats.objThe FATS module for DOS
fats_vbd.objVisual-Basic interface "FATSBASIC"

The following library is included on the distribution diskette to call the FATS Workstation Engine:

fatsvbdr.libVBDOS interface "FATSBASIC"

If you want to make calls to the extended version of FATS (FATSXWE.EXE), you have to use the library fatsxvbr.lib.

If you like to use the resident module FATS.COM to make the FATS calls, the object module fatsmb7t.obj in the directory DOS_16I\BASIC\MS provides the FABS PLUS compatible function FABSMB2.

 
Linking a Visual 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 tst1_eng
LINK tst1_eng fats.obj fats_vbd;

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

BC tst1_eng
LINK tst1_eng fatsvbdr.lib;

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

LINK tst1_eng fatsxvbr.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, long integer
KEYLEN%Length of key value, 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\VBDOS that illustrate how you can use the FATS commands in your programs:

 tst0_eng.basVBDOS test program (uses FBSVBDOS)
 tst1_eng.basVBDOS test program (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 Plus interface is available:

FBSVBDOSEntry Point in FATS.OBJ


 

© 2008  GCS Software, Udo Gertz