"this me"?
Monte Goulding
monte at sweattechnologies.com
Wed Aug 7 22:17:32 EDT 2013
On 08/08/2013, at 11:28 AM, Mike Kerner wrote:
> I'm not sure why "me" in "B" SHOULD output "A". If I was reading that code
> (with "me" instead of "this me"), I would say it would/should always say
> "B", not "A", and that we have the whole meaning of "me" messed up. I
> understand why things are the other way, but IMHO, "me" should be the
> object that contains the script, and something like "callingObject" or
> "object calling this script" should output "A".
The object with the behavior script is just a container. The script is basically appended to the script of the object that has it's behavior set so me should mean that object.
>
> HOWEVER, if I'm stuck with this behavior as described (UGH), then
>
> "the owner of this script"
> "the object this script belongs to"
> "the object containing this script"
> "the scriptContainer"
> "the scriptObject"
>
> are WAY better than "this me". Trevor, I think :-P would have been better
> than :-) when you suggested that.
Yeah... the scriptObject is one of my favorites. I don't think we can have multiple word functions so we need to camel case it.
>
>
> Can we PLEASE have ME be the object that contains the script? If you're in
> the script editor, and you see "ME", are you REALLY going to think "that's
> the object that's executing this script, but it might not be THIS object?
> Of course not.
Unfortunately behaviors have been in the engine for 5 years or so with me meaning the object with the behavior rather than the object with the script.
>
> Also, so that I understand (because the explanation in the release notes
> was a little less than ideal), what happens if, say, "C" does a "send
> mouseup" to "A"?
> a) what will "ME" do (should send me "B")?
> b) what will "THIS ME #justkillmenow" do?
If the behavior script is:
on mouseUp
put the short name of me & cr & the short name of this me
end mouseUp
The behavior script is contained in button B and set as behavior of button A then the message box should show:
A
B
Cheers
--
M E R Goulding
Software development services
Bespoke application development for vertical markets
mergExt - There's an external for that!
More information about the use-livecode
mailing list