Re: global variable not being recognized by script object
Re: global variable not being recognized by script object
- Subject: Re: global variable not being recognized by script object
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 28 Feb 2001 01:01:24 -0800
On 2/28/01 12:24 AM, "Richard 23" <email@hidden> wrote:
>
"my" also tells AppleScript to look outside of the current scope.
>
If a global is declared at the top level a single my reference
>
is sufficient (as long as the first occurence in the handler uses
>
my.
Aha! You have just provided invaluable service to users of Smile, Richard.
When calling entire handlers from a debugging Text window in Smile, you need
to have put "my" before any property or global variable from the main script
before "entering" the handler to use it in debugging. This is quite a
bother. It is because it behaves exactly as Scott described: the variables
in the "saved" (declared, what-have-you) handler don't know about any global
variables or properties when it is "entered". But if you only need to put
"my" once per variable, that's very convenient. I shall check it out.
--
Paul Berkowitz