Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I release a class
Message
From
17/06/1997 14:46:08
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00036657
Message ID:
00036682
Views:
55
>When I do the following in the Command Window, I get an error:
>
>1) Compile my project to an APP
>2) SET CLASSLIB TO myclass IN myapp && myclass is a VCX and myapp is an APP
>3) SET CLASSLIB TO && This is suppose to release all classes
>4) Recompile my project. Below is the error I receive:
>
>"Object file \myapp.app is in use and cannot be removed from memory." >(Error 1719)

I first wonder why you are trying this particular sequence...

Beyond that, "SET CLASSLIB TO MyClass IN MyApp" opens MyApp, locates the library MyClass if it is in there, and notes to the system that MyClass is to be searched first for any class references (such as in CreateObject()). This implies that the file MyApp.app remains open.

"SET CLASSLIB TO" then instructs VFP not to search any particular path for class references. *This does not close MyApp.app*

The attempt to recompile tries to overwrite a currently open file, and your error results.

>For step 3, I have tried CLEAR CLASS myclass and RELEASE CLASS myclass with no success. I looks like there might be a bug with the RELEASE command, because the help file says I can do the following:

>RELEASE CLASS myclass IN myapp
>
>When I do this, I get the following error:
>
>"Class library file \myapp.vcx is not found." (Error 1993)

These commands affect class libraries - your problem is with an open .app file.

> So, my question is how do I release class from memory without leaving FoxPro and coming back into FoxPro.

In order to helpfully answer your question, I need to return to my opening question - what is the effect you are trying to create here? "CLOSE ALL" might work, but it's a sledgehammer approach.
David M. Stowell
Ravenslake Consulting
Chicago, Illinois

e-mail: davidstowell@ravenslakeconsulting.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform