Page 2 of 2

Re: how to make a whole group into a target

Posted: Fri Apr 02, 2021 9:20 pm
by dunbarx
Jacque.

Well, almost. :wink:

If I have a handler in a locked field or button, both of which are containers, and where either control contains some text, then:

Code: Select all

on mouseup
   answer me
 end mouseup
returns the text itself, what I described as the "contents". If I place this handler into an object that is not a container, however, then that handler returns the short name of the target. We both know this.

I never liked the fact that "me", for objects that are not containers, returned the object name. I think that for consistency empty should be returned, or even throw an error.

Craig

EDIT. Of course this has nothing to do with the construction "of me", which does indeed reference the target itself, as opposed to the naked "me", which is what I wanted to restrict above to container contents only.

Re: how to make a whole group into a target

Posted: Sat Apr 03, 2021 5:03 pm
by jacque
I see. "Me" is still referencing the control but the engine resolves it, just as it does with field references; i.e., "put fld 1" also gives you the text. It's an ancient inheritance from HC. I suppose this could be confusing to new users.

Re: how to make a whole group into a target

Posted: Sat Apr 03, 2021 8:01 pm
by dunbarx
Jacque wrote:
I suppose this could be confusing to new users.
HC worked exactly this way. All those "me's" are very compact and useful if one is accustomed to them and their subtle variants. A short lesson on "me" might be useful, if anyone asks.

Craig