Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Moving a class between class libraries
Message
From
25/05/2001 10:29:37
 
 
To
25/05/2001 09:29:25
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00511477
Message ID:
00511511
Views:
23
>Is there a way to programmatically copy or move a class from one class library to another?

Either way, to copy it ADD CLASS.
Be careful here: If this is a class you instantiate with CREATEOBJECT() and you have a copy of the class in two different libraries, and issue SET CLASSLIB for both of them - so they're both in memory - a CREATEOBJECT() will use the one SET first. You can get around this by using NEWOBJECT() instead, which allows you specify the class library.

To move it, after ADD CLASS, REMOVE CLASS from the original library.
Be particularly careful here, because any classes derived from this class or form objects that are instances of this class will lose the reference to the parent class.
The only way, programmatically, to fix these is to hack each VCX (and SCX) containing a derived class or instance of the class and replace the classloc fields for those class or object records.
Insanity: Doing the same thing over and over and expecting different results.
Previous
Reply
Map
View

Click here to load this message in the networking platform