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 11:01:21
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
DEFINE CLASS x AS y FROM My.PRG
Divers
Thread ID:
00426810
Message ID:
00426810
Vues:
53
Many times folks ask for new VFP features that, after consideration, prove to be unneeded or logically unsound. I would like some opinions on this one.
Objects based on classes from VCX class libraries can always be created with one statement.
o = NEWOBJECT("MyClass", "TheClassLibrary.VCX")
Even when MyClass is a subclass of another class in another VCX, this works because the parent's VCX is pointed to from MyClass.
However, with PRG based classes the only way we can specify a parent class is to SET PROCEDURE TO ParentClass.PRG. Why can't we have syntax that allows the PRG based Class to know where to look for its parent? Example:
Test101.PRG
DEFINE CLASS Abstract AS Custom 
   PROCEDURE SomeThing(x)
   ENDPROC
ENDDEFINE

Test102.PRG
DEFINE CLASS Concrete AS Abstract FROM Test101.PRG
   PROCEDURE SomethingElse(x)
   ENDPROC
ENDDEFINE
What I'm proposing is that PRG based classes work exactly like VCX based ones. Each class definition needs to know where its parents are.
Charlie
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform