FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour oSefl vs. ::
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
oSefl vs. ::
Posted: Mon Apr 19, 2010 10:18 AM
What is the difference between oSefl and :: ?
Can someone please explain why oSelf is working and :: fails?

Code (fw): Select all Collapse
 local oSelf             := SELF
@ 10,10 BTNBMP oBtn OF ::oPanArt_WG;
           SIZE 160, 80 ;
               FONT oFnt ; 
            ACTION ( oSelf:oPanArt_WG:hide() ) NOBORDER TRANSPARENT

is working and

Code (fw): Select all Collapse
ACTION ( ::oPanArt_WG:hide() ) NOBORDER TRANSPARENT

fails.

Thanks in advance
Otto
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: oSefl vs. ::
Posted: Mon Apr 19, 2010 10:24 AM

Otto,

When we use: ... BTNBMP ... ACTION ...

ACTION ... gets preprocessed into:

[{|Self|<uAction>}]

But that "Self" will be provided to the codeblock as a parameter and it is not ::

So when we do local oSelf := Self
and then we use oSelf from the codeblock, we are using oSelf and not the provided parameter self

Little confusing but its simple :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion