Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP60- Existence of a property
Message
 
 
À
05/10/2000 13:50:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00425254
Message ID:
00425442
Vues:
11
>Nadya:
>
>I use them quite a bit because I often want read-write properties that are internal to the class but read-only to external objects. For example, I have a hidden flgNew property that is completly managed by the class and I expose it with a public IsNew method which simply returns flgNew. It's not fail-safe because the developer can always override/enhance the IsNew method, but it won't affect the internal working of the class (i.e the class protects itself against most developer abuse).

Yes, it seems more C++ style... For my regret, right now I work primarly with VFP and start to forget C++ :((
>
>Daniel
>
>>Thanks for the great explanation, Daniel. I haven't thought that this property >could be hidden, because I rarely use hidden properties in my work...
>
>>>If MyProperty is a hidden (protected) property and loObject is an instance of
>>>the class,
>>>
>>>Type('loObject.MyProperty') = 'U'
>>>PemStatus(loObject, 'MyProperty', 5) = .t.
>>>
>>>Not exactly the same the same results...
>>>
>>>By the way, to check if a property is
>>>
>>>Hidden
>>>------
>>>llRetVal = PemStatus(loObject, 'MyProperty', 5)
>>>llRetVal = llRetVal And PemStatus(loObject, 'MyProperty', 3) = 'Property'
>>>llRetVal = llRetVal And Not PemStatus(loObject, 'MyProperty', 2)
>>>llRetVal = llRetVal And Type('loObject.MyProperty') = 'U'
>>>
>>>
>>>Protected
>>>---------
>>>llRetval = PemStatus(loObject, 'MyProperty', 5)
>>>llRetVal = llRetVal And PemStatus(loObject, 'MyProperty', 3) = 'Property'
>>>llRetVal = llRetVal And PemStatus(loObject, 'MyProperty', 2)
>>>
>>>Public
>>>------
>>>llRetVal = PemStatus(loObject, 'MyProperty', 5)
>>>llRetVal = llRetVal And PemStatus(loObject, 'MyProperty', 3) = 'Property'
>>>llRetVal = llRetVal And Type('loObject.MyProperty') <> 'U'
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform