Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Q: read-only property, the shortest implementation?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00927230
Message ID:
00927410
Vues:
34
Anatoliy,

Any object created from the same parent class as the one where check is performed will pass your check.

>So far I decided on creating the InternalCall method in the base class:
>
>* InternalCall
>RETURN (AT(UPPER(THIS.class)+".", PROGRAM(PROGRAM(-1)-2))=1)
>
>to be called from _ASSIGN methods as follows:
>
>* myproperty_ASSIGN
>LPARAMETERS vNewVal
>IF THIS.InternalCall()
>    THIS.myproperty = m.vNewVal
>ELSE
>    ERROR 1533
>ELSE
>ENDIF
>
>So basically it's an extention of your idea of distinguishing between external and internall attempts to change the value of a property.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform