The Properties Help Page
Publicado: Jue Nov 30, 2006 10:13 pm
Hi Guys
Not sure if I'm doing something wrong or the example is wrong
From the help
For example:
PROPERTY cText INIT "" READ ::GetText() WRITE ::SetText( Value )
I can get this work, it actually seems to need to be
PROPERTY cText INIT "" READ GetText WRITE SetText
I started with this
CLASS Test
PUBLISHED:
PROPERTY cText INIT "" READ ::GetText() WRITE ::SetText( Value )
PRIVATE:
DATE FTest
END CLASS
METHOD GetText()
RETURN FTest
METHOD SetText(s)
FTest := s
RETURN FTest
But I kept getting a run error saying Test wasn't a property
By removing the :: and the () from the READ/WRITE is started working
I also could get it to compile this
PROPERTY cText INIT "" READ METHOD GetText WRITE METHOD SetText
At the bottom of the help is says this is the best way to use it.
Thanks
Nick
Not sure if I'm doing something wrong or the example is wrong
From the help
For example:
PROPERTY cText INIT "" READ ::GetText() WRITE ::SetText( Value )
I can get this work, it actually seems to need to be
PROPERTY cText INIT "" READ GetText WRITE SetText
I started with this
CLASS Test
PUBLISHED:
PROPERTY cText INIT "" READ ::GetText() WRITE ::SetText( Value )
PRIVATE:
DATE FTest
END CLASS
METHOD GetText()
RETURN FTest
METHOD SetText(s)
FTest := s
RETURN FTest
But I kept getting a run error saying Test wasn't a property
By removing the :: and the () from the READ/WRITE is started working
I also could get it to compile this
PROPERTY cText INIT "" READ METHOD GetText WRITE METHOD SetText
At the bottom of the help is says this is the best way to use it.
Thanks
Nick