Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Protected and Public
Message
De
31/05/1999 20:18:09
 
 
À
31/05/1999 09:01:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00224370
Message ID:
00224777
Vues:
20
I understand you redefine the Display method in the form. In this case, protected properties are not visible.

Protected prop/methods are visible from the class where they are defined and from derived classes. When you redefine a method for an object in a form, the redefinition applies only to that instance of the class. This is not in the same class or in a derived class. IMO, this is the correct behavior (because this code is in fact in the Form).

Vlad

> I still abit confuse with it. Let's use an example:
>I have a timer class: mytimer
>method:
>Display
>?this.nhour
>?this.nmin
>?this.nses
>
>property:
>nhour (protected)
>nmin (protected)
>nsec (protected)
>
>I have added mytimer class into myform and inherint the display method with the following code.
>Inherintance method:
>Display
>?"Hour:" + str(this.nhour)
>?"minute:" + str(this.nmin)
>?"second:" + str(this.nsec)
>
>But i have an error message when run-time: Property nhour is not found
>
>Why?
>
>Thank you
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform