Opens an external API (application programming interface) library file.
Syntax
SET LIBRARY TO [FileName [ADDITIVE]]
Arguments
FileName
Specifies the file name of the API library or procedure file to open.
Visual FoxPro assume an .fll extension for libraries. If the library has an .fll extension, you don't have to include the extension with the file name. If a library has an extension other than .fll, you must include the extension with the file name.
Important When using SET LIBRARY, be aware of the following:
Visual FoxPro assumes a .prg extension for a procedure file.
When you execute a procedure with DO ProcedureName, Visual FoxPro searches for the procedure in the following files in this order:
ADDITIVE
Opens additional API libraries. Include ADDITIVE after the file name in successive SET LIBRARY commands.
Visual FoxPro ignores ADDITIVE when you use SET LIBRARY to open a procedure file.
Remarks
Use SET LIBRARY to open external Application Program Interface (API) libraries or a procedure file.
API routine libraries extend the capabilities of the Visual FoxPro language and user interface. Once an external API library is opened, you can use the API functions as if they were Visual FoxPro functions. Use DISPLAY STATUS or LIST STATUS to display the library's available functions.
You can use existing API libraries or create your own API libraries.
In Visual FoxPro, the preferred way to register functions in shared libraries is to use the DECLARE - DLL command.
To remove all API libraries from memory, use SET LIBRARY TO without including FileName or ADDITIVE. To remove an individual library from memory, use RELEASE LIBRARY LibraryName.
If you specify a procedure file, the procedures within the procedure file are made available to all programs and are also available interactively through the Command window.
Note The ability of Visual FoxPro to open a procedure file with SET LIBRARY provides compatibility with dBASE IV. Using SET LIBRARY to open a procedure file will close all open API libraries. Using SET LIBRARY to open API libraries will close a procedure file opened with SET LIBRARY. Use SET PROCEDURE to open a procedure file and prevent API libraries from being closed.
For additional information about procedure files, see PROCEDURE and SET PROCEDURE.