Set ClassLib, Set("ClassLib"), Release ClassLib
Set ClassLib lets you add class libraries to the list of places FoxPro looks for class definitions when you refer to one. Release ClassLib removes a class library from that list. Set("ClassLib") shows you the current list.
Usage |
SET CLASSLIB TO [ ClassLibrary1 [ IN AppOrExeFile1 ] [ ALIAS ClassAlias1 ] [, ClassLibrary2 [ IN AppOrExeFile2 ] [ ALIAS ClassAlias2 ] [ ... ] ] [ ADDITIVE ] ] cClassList = SET( "CLASSLIB" ) RELEASE CLASSLIB ClassLibrary1 | ALIAS ClassAlias1 [ IN AppOrExeFile1 ] [, ClassLibrary2 | ALIAS ClassAlias2 [ IN AppOrExeFile2 ] [ ... ] ] |
Parameter |
Value |
Meaning |
ClassLibraryx |
Name |
The file name of a class library to add to or remove from the search chain. For SET CLASSLIB, include the path if it's not in the FoxPro path. |
Omitted |
In SET CLASSLIB, remove all libraries from the search path. |
|
AppOrExeFilex |
Name |
The name of an APP or EXE file into which the class library is built. |
Omitted |
Look for the class library as a separate file on disk, or in the current EXE or APP. |
|
ClassAliasx |
Name |
An alias by which to refer to the class library. |
Omitted |
Use the file name (first part up to the ".") as the alias. If you use spaces in the file name (and please reconsider if you do!), they are replaced with underscores in the alias. |
|
cClassList |
Character |
The complete list of class libraries that are currently being used, including paths and aliases. |
Empty |
No class libraries are in the search path. |
RELEASE CLASSLIB was enhanced in a couple of ways in VFP 5, but they didn't do a very good job of it. The IN clause was added to allow you to release class libraries that are built into applications. However, using it gives an error unless there's a class library of the same name in the directory from which you SET the CLASSLIB. You have to use the ALIAS form of the command to release such a class library. |
But wait, there's more. You can use the IN clause only once in RELEASE CLASSLIB, and it must be the last clause. Any libraries you list after the IN clause are ignored. Although it's documented that way, we consider this a bug because there's no logical reason for the command to behave this way. |
Example |
SET CLASSLIB TO CoolStuf CREATE CLASS MyDateSpinner OF MyStuff AS DateSpinner RELEASE CLASSLIB CoolStuf cOldClassLib = SET("CLASSLIB") SET CLASSLIB TO Connect ADDITIVE oConn = CreateObject("ConnMgr") SET CLASSLIB TO &cOldClassLib |
See Also |
Create ClassLib, CreateObject(), NewObject(), Release, Release Library, Release Procedure, Set Library, Set Path, Set Procedure |