FATS - Fast Access Tree System
Table of Contents
Programming Interfaces
BasicA, GWBasic, Basic 86, CB86

BasicA, GWBasic, Basic 86, CB86


 
FATS.COM (resident module)

To execute FATS commands from interpretative BASIC, your application must load the resident version of FATS before you can run your BASIC application.

The Basic Interface is an assembly language subroutine, called FATS.COM, which the BASIC application must call in order to communicate with FATS. In a multiuser- or network system, each station must have its own copy of FATS.COM. Once you load the interface, your application uses the ABSOLUTE CALL statements to execute FATS commands. The Interface fixes itself in memory until the next computer restart.

In order to load the interface, enter the following command:

FATS [fseg name]

You can specifiy the name of the file where the interface will write the segment address at which it loaded, otherwise it will default to FSEG.
In a network environment, it is important that the file name you specify is either a local or unique file name. Since the segment address where FATS.COM loads may vary from station to station, each one must have its own segment address file to read.
Note: You should not load the interface more than one time to avoid multiple instances of the resident module in memory.

 
Initiating FATS

FATS.COM writes a single record to the output file you specified containing the segment address, in hexadecimal notation, at which it loaded. Your program should include the following statements to read and define the segment address to use for FATS calls:

REM
REM -------> get segment address of interface
REM
OPEN "I" , #1, "FSEG"
INPUT #1, FSEG
CLOSE #1

 
Calling FATS

To execute FATS commands you simply define a command string (CMND$) and then call the following subroutine:

FATSCALL:
REM
REM *** call FATS ***
REM
FTSBASIC=&H5
DEF SEG=FSEG
CALL FTSBASIC (CMND$, FATSERR%, RECLO%, KEYADR%)
RECLO=RECLO% : IF RECLO<0 THEN RECLO=RECLO+65536!
KEYADR= KEYADR% : IF KEYADR < 0 THEN KEYADR = KEYADR + 65536!
CMND$ = "X"
CALL FTSBASIC (CMND$, DUMMY%, RECHI%, DUMMY%)
RECHI=RECHI% : IF RECHI<0 THEN RECHI=RECHI+65536!
RECNO=RECLO+RECHI*65536!
DEF SEG
RETURN

The following subroutine returns the FATS key value from the last search command:

FATSGETKEY:
REM
REM *** get basic string from fatskey ***
REM
FATSKEY$=""
FOR X= KEYADR TO KEYADR + 24
DEF SEG=FSEG
FATSI=PEEK(KEYADR)
DEF SEG
FATSKEY$=FATSKEY$+CHR$(FATSI)
KEYADR = KEYADR + 1
NEXT X
RETURN

Please take notice of the additional information at pages  4-77, 9-77 and 9-77.

 
Testprograms

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

 tst0_eng.basTest program for BasicA, GWBasic etc.


 

© 2008  GCS Software, Udo Gertz