|
VBX-Controls FATS_VBW.VBX / FATSXVBW.VBX
The diskette FATS for Windows 3.x contains the files FATS_VBW.VBX & FATS_WIN.DLL (basis version) or FATSXVBW.VBX & FATSXWIN.DLL (extended version), which must be copied into the system directory of Windows:
COPY FATS?WIN.DLL \WINDOWS\SYSTEM
COPY FATS?VBW.VBX \WINDOWS\SYSTEM
The libraries FATS_VBW.VBX respectively FATSXVBW.VBX are Custom Controls particulary developed for Visual Basic and export the following functions:
Declare Function FatsSetup Lib "FATS_VBW.VBX" () As IntegerDeclare Function FatsTerminate Lib "FATS_VBW.VBX" () As Integer
Declare Sub FATSBASIC Lib "FATS_VBW.VBX" (ByVal szCmnd As String,nErrorcode%, dwRecno&, szFatsKey$)
The functions FatsSetup and FatsTerminate are only needed if you do not use a FORM module in your program:
segFatsdata = FatsSetup() | ' initializes the FATS data area |
segFatsdata = FatsTerminate() | ' releases the FATS data area |
By using this functions in the Visual Basic development environment FATS has no possibility to close opened files and release the data area assigned to it at the moment you truncate the application. Because this can cause strange behaviour you should prefer the following method.
If you have at least one FORM module in your program, then the method of including FATS is very simple:
1.) | Load the FATS Custom Control with the menu command "ADD FILE". Then the Toolbox displays the symbol of FATS | 2.) | Place the FATS control in a form module. During the execution of your Visual Basic program the control is invisible. | 3.) | Because the development environment maybe did not close still-opened files you should execute the FATS command "K" at the beginning of the program in order to close all still opening files correctly. |
Calling FATS
FATS commands are executed with the function FATSBASIC :
CALL FATSBASIC(CMND$, ERRORCODE%, RECNO&, FATSKEY$)
Parameter Usage:
CMND$ Command string (input) ERRORCODE% Errorcode (output), integer RECNO& Record number, long integer FATSKEY$ Key value (output)
Testprograms
The FATS distribution disk for Windows 3.x contains some test programs in the directory WIN_16I\BASIC\VBWIN that illustrate how you can use the FATS commands in your programs:
tst1_eng.mak Test program for MS-Visual-Basic for Windows tst1_eng.frm (form module) tst1_eng.bas (program module)
The extended version of FATS contains the following additional test programs:
tst2_eng.frm Introduction to the Matchcode Functions mcsort.frm Use of the key-flag with command 'MC'
© 2008 GCS Software, Udo Gertz