Article ID: 131133
Article Last Modified on 2/15/2000
*--------------------------------------------------------------*
* PROGRAM: PROTTEST.PRG *
* *
* Copy this code into a PRG and then execute the PRG. *
*--------------------------------------------------------------*
oMyObject = CREATEOBJECT("MyClass")
? oMyObject.One
* The command shown above fails because property ONE is not *
* being accessed through a method of the custom class. When *
* this fails, choose IGNORE and the program will continue. *
? oMyObject.ProtProperty("ONE")
? oMyObject.ProtProperty("TWO")
? oMyObject.ProtProperty("THREE")
DEFINE CLASS MyClass AS Custom
PROTECTED One, Two, Three
One = "ONE"
Two = 2
Three = "THREE"
FUNCTION ProtProperty(lcProperty)
RETURN EVAL("THIS."+lcProperty)
ENDFUNC
ENDDEFINE
*--------------------------------------------------------------*
Additional query words: VFoxWin Encapsulation read_only
Keywords: kbcode KB131133