Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DEFINE CLASS Command
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00764418
Message ID:
00764525
Vues:
26
Kevin,

A hidden property isn't accessible from outside of class definition. You can either use protected property or move GET method into parent class.
o = CREATEOBJECT("Child")
? o.GetProp()

DEFINE CLASS Child AS Parent

ENDDEFINE

DEFINE CLASS Parent AS Custom
  HIDDEN MyProp
  MyProp = .T.
  PROCEDURE GetProp
    RETURN This.MyProp 
  ENDPROC

ENDDEFINE
>Let me ask another question:
>
>I want to create a property in a base class, and use it in sub-classes.
>But I want it hidden. How do I do this?
>
<snip>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform