Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Q: read-only property, the shortest implementation?
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00927230
Message ID:
00927410
Views:
35
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform