Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DEFINE CLASS x AS y FROM My.PRG
Message
De
09/10/2000 15:12:31
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, États-Unis
 
 
À
09/10/2000 12:46:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00426810
Message ID:
00426994
Vues:
24
Hi Fred,
Just to be sure I tested your scenario. When you create a subclass you must specify a class in a classlib. The SET CLASSLIB TO has no effect in the parent that is used. A child class knows the file in which its parent resides. It does not care what SET CLASSLIBs you current have in effect, except to the extent that the class must get to its own classlibrary. Its parent class is defined explicitly. However, PRG based classes DO work as you state. This seems to me a very bad thing. I should have to specify a specific file to create a subclass. So I still think the FROM keyword makes a lot of sense for PRG based classes in that it tells the developer where to find the parent class, just as in VCX based classes.
>
>I'm not entirely sure that VCX based classes work truly in that manner. If you have a heirarchy of classes that are the same name, your subclass would be based off of whatever one is the top level according to your SET CLASSLIB order.
>
>In other words:
>
>ONE.VCX has a class named MYFORM based on FORM.
>TWO.VCX also has a class named MYFORM based on FORM.
>
>Now at run time, you instantiate a class from THREE.VCX based on MYFORM, it will actually be based on whichever library is in first in your SET CLASSLIB order.
>
>SET CLASSLIB TO ONE.VCX
>SET CLASSLIB TO TWO.VCX ADDITIVE
>
>You'll get the MYFORM class from ONE.VCX.
>
>SET CLASSLIB TO TWO.VCX
>SET CLASSLIB TO ONE.VCX ADDITIVE
>
>You'll get the MYFORM class from TWO.VCX.
>
>This sure seems to be the way it works.
Charlie
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform