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

Re: variables vrs properties


  • Subject: Re: variables vrs properties
  • From: KOENIG Yvan <email@hidden>
  • Date: Wed, 5 Jan 2011 17:27:30 +0100

Le 5 janv. 2011 à 16:32, Luther Fuller a écrit :

>
> On Jan 5, 2011, at 9:10 AM, Jim Brandt wrote:
>> What exactly are the advantages/disadvantages to using properties over variables?
>>
>> Property	•	global within scope
>> 		•	retains value until script is recompiled
>>
>> Variable	•	global within scope only if declared global
>> 		•	doesn't retain value between executions
>
> I always compile my scripts as application bundles, so these remarks may not apply if you don't.
>
> You can change the value of a property in an AppleScripted application, but probably shouldn't because that makes your application file self-modifying. This is not compatible with codesigning (which I don't yet use).
>
> Global variables are a bad thing for the same reason. Global variables ARE persistent ... they DO retain their value between executions. For this reason, I never use globals.

In my scripts I reset the properties to their original value.
I don't use them to get persistent items but to fasten lists treatment.

Yvan KOENIG (VALLAURIS, France) mercredi 5 janvier 2011 17:27:23



 _______________________________________________
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

References: 
 >variables vrs properties (From: Jim Brandt <email@hidden>)
 >Re: variables vrs properties (From: Luther Fuller <email@hidden>)

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