Hi Luiz,

You can't use the operator ':=' on any scalar class, because character, 
numeric, etc. it's not an object and not it's self referenced. Only 
Scalar Class for Arrays is Referenced.

you're example it's a bad implementation of ASSOCIATE CLASS

Regards,

Andres Reyes

Luiz Rafael Culik Guimaraes escribió:
> Dear Friends
>
> How to use operator := on an associate class
>
> this code bellow dont work even if i have the operator := defined
>
> #include "hbclass.ch"
> PROCEDURE Main()
> local cVar,v:="",l:=""
>
>
>    cVar:='aaa'
>    ASSOCIATE CLASS MCharacter WITH TYPE CHARACTER
>    ASSOCIATE CLASS MCharacter WITH TYPE NIL
>                                   
>    ? cVar:UPPER() // AAA
>    ? cVar // aaa
>    v="bbb"
>    ? v:= v+"a"
>    ? v+="c"
>    ? v:=cVar // this should return in upper cased
>    ? v
>    ?l:="aaaaaa"
>
>
> RETURN
>
> CLASS MCharacter
>     METHOD UPPER()   inline Self:=upper(Self)
>     Operator  "=" arg xArg  inline  Self:=upper(xArq),Self
>     Operator  "+" arg xArg  inline  Self:=Self+upper(xArg)
>     Operator  "+=" arg xArg  inline  Self:=Self+upper(xArg)
>     Operator  ":=" arg xArg  inline  Self:=upper(xArg)
>
> ENDCLASS
>
> Regards
> Luiz
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
> Don't miss this year's exciting event. There's still time to save $100. 
> Use priority code J8TL2D2. 
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> xHarbour-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/xharbour-developers
>
>   



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
xHarbour-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xharbour-developers

Reply via email to