Anatoliy,
>In FoxPro class I want to create read-only property. Its value can be changed by internal method(s) of the class, but can not be changed by direct assignment when an object is instantiated from this class.
>
>So far the best I can do is combination of protected "shadow" property and ASSIGN method for the base property. The code is very abstract, just an example of general idea:
Here's what I think is the way to do this.
obj = CreateObject("myclass")
? obj.GetHWindow()
? obj.SetHWindow
DEFINE CLASS myclass As Custom
HIDDEN HWindow
HWindow = 0
PROCEDURE Init
This.SetHWindow
RETURN
ENDPROC
FUNCTION GetHWindow
RETURN This.HWindow
ENDFUNC
PROCEDURE SetHWindow
DECLARE INTEGER GetFocus IN user32
This.HWindow = GetFocus()
RETURN
ENDPROC
ENDDEFINE
How's that?
George
Ubi caritas et amor, deus ibi est