Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sub-Classing a PRG-based Class
Message
From
27/05/2002 20:46:53
 
 
To
27/05/2002 17:35:31
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00661784
Message ID:
00661823
Views:
26
Bill, see http://fox.wikis.com/wc.dll?Wiki~VisualFoxProInvocationStack

Say I have a class definition XX in RatFace.PRG

I would *never* recommend
DEFINE CLASS YY AS XX from Ratface.PRG
 * ..
ENDDEFINE
(Just because you can do something doesn't mean you should. When you hard-code the parent class location, you loose all the ability of flexibly use your invocation stack.)

Instead, in your Main.PRG or shortly thereafter in startup
SET PROCEDURE TO Foo, Bar, ..., Ratface, ...
Then anywhere
DEFINE CLASS YY AS XX 
 *  ..
ENDDEFINE
**--** Steve



>>What's the best way to sub-class a PRG based class?
>>
>>I presume that I can "#INCLUDE < parent.prg >" in each sub-class.prg (so I get the inheritance), but then how do I get the sub-class.prg to re-compile when I edit the parent.prg?
>>
>>Specifically, if I create a class based on the SESSION object, how can I then sub-class it to get all the inheritance from the main class?
>
>I just discovered that I CAN'T "#INCLUDE < parent.prg >" in a sub-class.prg because only #DEFINE statements are recognized in a #INCLUDEd file.
>
>Is there some way to get a PRG-based class into SET CLASSLIB?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform