>obj = CreateObject("myclass") >? obj.hwindow >* obj.hwindow=0 && generates an error >* end of main > >DEFINE CLASS myclass As Custom >PROTECTED _hwindow > hwindow=0 > >PROCEDURE Init > THIS.GetHWindow > >PROCEDURE hwindow_ASSIGN(newvalue) > ERROR 1740, "HWindow" > >PROCEDURE hwindow_ACCESS >RETURN THIS._hwindow > >PROTECTED PROCEDURE GetHWindow > DECLARE INTEGER GetFocus IN user32 > THIS._hwindow=GetFocus() > >ENDDEFINE >>Is there a better way? Somehow this triple-member does not look Ok.
PROTECTED _hwindow
to:HIDDEN _hwindow
To prevent access and changes to the properties from outside of the class definition. Only methods and events within the class definition can access the hidden properties. While protected properties can be accessed by subclasses of the class definition, hidden properties can only be accessed from within the class definition.
"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."
- Ephesians 4:29-30 NIV
Dare to Question -- Care to Answer
Time is like water in a sponge, as long as you are willing you can always squeeze some.
--Lu Xun, Father of Modern Chinese Literature