Weirdness Passing Messages

David Burgun dburgun at dsl.pipex.com
Thu Mar 23 12:47:51 EST 2006


Hi,

Thank you sooooooooooo much, you have no idea of how it felt to be  
trying to sort this out. I really don't know much about the internals  
of RunRev to have a clue as to where to start looking sometimes!

The one thing that REALLY hacks me off is that there is no mention of  
this at all in the documentation that I can find:

 From the 2.6.6 dictionary:

me keyword

Platform support:
Introduced in version 1.0

Equivalent to the object that contains the currently running handler.

set the borderWidth of me to it
put the short ID of me into savedID
put me into myVariable -- puts contents, if me is a container
put me into myVariable -- puts name, if me is not a container

See also: it keyword, target function, target keyword, text property

Description
Use the me keyword within a handler to determine which object's  
script is executing.

Comments:
The me keyword is a reference to the object whose script contains the  
current handler.

If the currently executing handler is in the script of the object  
that received the original message, then me is the same as the object  
whose name is returned by the target function. For example, suppose a  
button script contains a mouseDown handler. The value of the target  
function within that mouseDown handler is the same as the name of me:  
the name of the button.

However, if the mouseDown handler is in the card's script instead of  
the button's, me is not the same as the object specified by the  
target. In this case, me is the card, but the target function returns  
the button's name, because the button is the object that first  
received the mouseDown message.

The me keyword can be used anywhere an object reference is used.

---------------------------------------------------
How hard would it have been to add something like:

the form put <something> into me may not always work depending on  
context. To be safe use the following form:

set the text of the long name of me to <something>

If you would like it to work 100% of the time.

I also checked the PDF file that came with 2.7, no mention of that  
there either!

All I can say is "thanks for nothing RunRev, you just cost me 2 days  
of hair pulling!!!!"

Thanks again
All the Best
Dave





More information about the Use-livecode mailing list