Re: Scope
Re: Scope
- Subject: Re: Scope
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 13 Dec 2002 02:55:00 -0800
On 12/13/02 12:44 AM, "Emmanuel" <email@hidden> wrote:
>
At 12:56 PM -0800 12/12/02, Paul Berkowitz wrote:
>
>
> tell g to set var3 to anotherHandler(var1)
>
>
I suspect a matter of scope, like you do, and I would really try
>
>
tell g to set var3 to anotherHandler(A's var1)
>
>
I am familiar with this kind of problem. If (in Smile) some object's
>
script owns some property "p", then if its handlers are called only
>
from the object's script I need no special precaution, I may use
>
simply "p" in the script. But if the handlers are supposed to be
>
called from another [object's] script, it is necessary that I specify
>
whose p that is:
>
>
[script of the called object]
>
property p:""
>
>
on DoIt(theObject) -- thus it's better to always pass that reference
>
-- use "theObject's p" always
>
end
>
Thank you, Emmanuel.
For good luck, I had tried
tell g to set my var3 to its anotherHandler(var1)
but I didn't think it was going to do much good. But
tell g to set my var3 to its anotherHandler(my var1)
might do better. However, in the called script, there is no property var1.
the only var1 is the one passed as a parameter to anotherHandler(var1).
Since I'm not passing a script object, just a variable representing an
integer (actually, quite a few variables, not just one), the called script
doesn't know who's calling it. Or am I misunderstanding you?
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
References: | |
| >Re: Scope (From: Emmanuel <email@hidden>) |