Página 1 de 1

The Properties Help Page

Publicado: Jue Nov 30, 2006 10:13 pm
por Nick Hilder
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

The Properties Help Page

Publicado: Vie Dic 01, 2006 9:46 am
por ignacio
Nick,
Take a look at OOP chapter in the help file. It should be this way:
PROPERTY cText INIT "" READ GetText WRITE SetText
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Nick Hilder" <nick_Nospam#$%@capsol.com%NOSPAM%.au> escribió en el mensaje
news:[email=456f4974@news.xailer.com...]456f4974@news.xailer.com...[/email]
> 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
>