• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: global variable not being recognized by script object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: global variable not being recognized by script object (From: Richard 23 <email@hidden>)

  • Prev by Date: [ANN] AppleScript workshop for intermediate scripters
  • Next by Date: Re: Handler joy
  • Previous by thread: Re: global variable not being recognized by script object
  • Next by thread: Re: global variable not being recognized by script object
  • Index(es):
    • Date
    • Thread