Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sub-Classing a PRG-based Class
Message
De
27/05/2002 17:36:43
 
 
À
27/05/2002 17:29:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00661784
Message ID:
00661796
Vues:
26
Look:
**- Parent.prg
define class MyParentClass as Session
 
  MyProperty = "Hi!"

enddefine
So, the above class has a Property. Now:
**- Son.prg
define class MySonClass as MyParentClass of Parent.prg

procedure SayHi
   Return this.MyProperty
endproc

enddefine
As you can see, on the second class definition, we doesn´t need to declare MyProperty property, as that was done on the Parent Class. But,
on the specialized Method SayHi() on the child class, you can see that it can invoke the MyProperty property, defined on the parent class. You can anytime change that property on the parent class, and all the child classes will inherit.

Is that what you want?
Claudio Lassala
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform