oSefl vs. ::

oSefl vs. ::

Postby Otto » 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: Select all  Expand view

 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: Select all  Expand view
ACTION ( ::oPanArt_WG:hide() ) NOBORDER TRANSPARENT

fails.

Thanks in advance
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6329
Joined: Fri Oct 07, 2005 7:07 pm

Re: oSefl vs. ::

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 92 guests