• 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: *Very* strange script / global variable behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: *Very* strange script / global variable behavior


  • Subject: Re: *Very* strange script / global variable behavior
  • From: Axel Luttgens <email@hidden>
  • Date: Sun, 13 Mar 2005 20:48:09 +0100

(and I again forgot to change the recipient field...)

Paul Berkowitz wrote:
On 3/13/05 8:01 AM, "Axel Luttgens" <email@hidden> wrote:

By contrast, should someone have asked why following code errors,
everybody would have said "hey! that's normal! you wouldn't want to be
able to clash local variables that way, would you?":

    -- Code4
    set SomeProp to "xyz"

    script LogIt
        log SomeProp
    end script

    tell LogIt to run
    --> Error: variable SomeProp is undefined

So, everyone would understand the error produced by Code4 because of
basic and almost universal programming rules.


Hmmm? SomeProp is not a local variable.
I disagree ;-)
Within Code4, SomeProp designates a entity local to LogIt's implicit run handler.
As well as a global variable implicitely declared at the script's top-level.
And those two beasts, the local one and the global one, really are distinct.

It is only when other scoping hints are provided, such as in your Code4A or in my Code1bis, that identifier SomeProp may be brought to designate the same global entity.


Axel


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: *Very* strange script / global variable behavior
      • From: Paul Berkowitz <email@hidden>
References: 
 >Re: *Very* strange script / global variable behavior (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: Folder Action to create Archive
  • Next by Date: Re: Scripting Energy Saver to Sleep Display Now?
  • Previous by thread: Re: *Very* strange script / global variable behavior
  • Next by thread: Re: *Very* strange script / global variable behavior
  • Index(es):
    • Date
    • Thread