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:
00927404
Vues:
25
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform