• 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 variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: global variables


  • Subject: Re: global variables
  • From: Kaydell Leavitt <email@hidden>
  • Date: Wed, 17 Jul 2013 14:27:25 -0600

Hi Luther,

On Jul 17, 2013, at 2:13 PM, Luther Fuller <email@hidden> wrote:

Global variables are persistent.

In other words, when you launch an application, the values from the previous launch are remembered.

This means that the application (bundle) is self modifying.

Which, in turn, means that use of global variables will interfere with, for example, codesigning and perhaps other security measures used in Lion or Mt Lion.

For this reason, I never use global variables and never modify a property.

If any of this has changed recently perhaps someone can update us.

I tried a global variable with the following code.

global x
set x to 2
set x to x + 1
display dialog "x: " & x

It always displays 3 as the result.

I don't know what you mean about global variables modifying their bundles.

I have read that properties are more persistent than global variables, but I can't say that I understand properties, but I think that I understand global variables.  I believe that global variables are defined for the entire script -- even inside of handlers.  I thought that this was all that their is to global variables, having the scope of the entire script.

-- Kaydell
email@hidden
http://learnbymac.com





 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: global variables
      • From: 2551 <email@hidden>
    • Re: global variables
      • From: Luther Fuller <email@hidden>
    • Re: global variables
      • From: Axel Luttgens <email@hidden>
    • Re: global variables
      • From: Stan Cleveland <email@hidden>
References: 
 >global variables (From: Jim Brandt <email@hidden>)
 >Re: global variables (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: global variables
  • Next by Date: Re: global variables
  • Previous by thread: Re: global variables
  • Next by thread: Re: global variables
  • Index(es):
    • Date
    • Thread