|
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.obj The FATS module for MS-DOS fats_mb6.obj MS-Basic interface for NEAR-strings, *or* fats_mb7.obj MS-Basic interface for FAR-strings (/Fs)
The following libraries are included on the distribution diskette to call the FATS Workstation Engine:
fatsmb6r.lib interface for NEAR-strings, *or* fatsmb7r.lib interface 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.bas MS-Basic (uses FABSMB) tst0eng7.bas MS-Basic Version 7.0 (uses FABSMB3) tst1eng6.bas MS-Basic (uses FATSBASIC) tst1eng7.bas MS-Basic Version 7.0 (uses FATSBASIC) rebuild.bas Re-Indexing a Data File (commands 'BK', 'DL')
The extended version of FATS contains the following additional test programs:
tst2_eng.bas Introduction to the Matchcode Functions mcsort.bas Use of the key-flag with command 'MC' reindex.bas Fast 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:
FABSMB Entry point in FATS.OBJ (near-strings) FABSMB2 Calling the resident version FATS.COM
(object file FATSMB7T.OBJ)FABSMB3 like FABSMB, however for Basic ver.7
(object file FATS_MB7.OBJ)
© 2008 GCS Software, Udo Gertz