• 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: parent properties - limited access inside child's handlers?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: parent properties - limited access inside child's handlers?


  • Subject: Re: parent properties - limited access inside child's handlers?
  • From: Nigel Garvey <email@hidden>
  • Date: Sun, 4 Feb 2001 13:41:11 +0000

"Jason W. Bruce" wrote on Sat, 03 Feb 2001 14:12:21 +0000:

>Arthur J Knapp" <email@hidden> wrote:
>
>> The keyword "my" or "of me" is used to refer to inherited
>> properties, (otherwise, AppleScript assumes a local variable/
>> property).
>
>Yes, but when a child script loads a parent script, the child script in its
>top level can refer to properties declared at the top level of the parent
>script without using "my" or "me" or "of parent", which seems like an
>inconsistency in the implementation of the inheritance mechanism.

It's not inconsistent with the behaviour described in the AppleScript
Language Guide, but the terminology *is* confusing.

One of the differences between declared and inherited properties is that
declared ones are visible to a compiler, which can then compile any
handlers used in the declaring script as "property aware". This is of
course not the case with inherited properties, which are only passed to
child scripts at run time. In this case, for want of any information to
the contrary, the scope of a variable with an inherited property's name
is compiled to the same rules any other variable used in that script.

In Jeff's script, 'a1' is only ever mentioned inside a handler and is
therefore compiled as a local variable. It needs a global declaration, a
property redeclaration, or a 'my' to alert the compiler to the fact that
other arrangements have to be made.

NG


  • Prev by Date: New to Applescript
  • Next by Date: Re: Can a script create an applet?
  • Previous by thread: Re: parent properties - limited access inside child's handlers?
  • Next by thread: Re: AppleWorks formatting and Glossary (was: Intro and Can this bedone?)
  • Index(es):
    • Date
    • Thread