Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Skipping inheritance
Message
De
08/06/2003 15:50:53
 
 
À
08/06/2003 15:15:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00797802
Message ID:
00797814
Vues:
25
>>>I'm using VFP 7.0
>>>
>>>In one of my classes, I want to skip the parent.method() code, but still get the parent.parent.method() code.
>>>
>>>I remember something about the :: operator, but cannot find anything in the help file that helps.
>>>
>>>TIA
>>
>>It is called the "scope resolution operator", but I can't find it in the help right now, either.
>>
>>In most cases, in VFP 5 or later, it can be replaced with DoDefault(), but you can still use it, for instance, for the case you mention.
>>
>>I think a complete example would be like this:
>>
>>
>>lnReturnValue = GrandParent::MyClass(Par1, Par2)
>>
>>
>>Of course, you might omit the return value or the parameters or both, depending on your specific needs.
>>
>>HTH,
>>
>>Hilmar.
>
>Hi Hilmar,
>
>>lnReturnValue = GrandParent::MyClass(Par1, Par2)
>I'm presuming that I would replace "GrandParent" with the actual name of my grandparent class.
>
>Do you know if there is some generic way to get at that name?
>I would like to allow for the possibility of inserting a class in between the current parent class and current grandparent class (redefine parent to ??, making the grandparent a greatgrandparent). I would still want to inherit from the new grandparent.
>
>Bill

How about...

This.Parent.ParentClass ?

BOb
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform