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

Re: ListWillNotEmpty


  • Subject: Re: ListWillNotEmpty
  • From: "DigitEL @ Shaw" <email@hidden>
  • Date: Fri, 08 Nov 2013 03:18:41 -0800

Thanks, Axel... its been years but I remember now something about the difference between 'set' and 'copy', subtle and very important distinction, hmmm, need to read more on this 'data sharing'.

Thanks again!
EL

On Nov 8, 2013, at 1:28 AM, Axel Luttgens wrote:

> Le 8 nov. 2013 à 09:31, DigitEL @ Shaw a écrit :
>
>> Hey >
>>
>> I have the following:
>>
>> 	set displayList to {}
>> 	set displayList to the mainList
>> 	set beginning of displayList to "----"
>>
>> Each time I run the script the "----" keeps getting added cumulatively to displayList even though displayList should be emptied out. Meanwhile mainList occurs only once. Any idea why this is happening... a bug or is it the Tao of AS?
>
> Hello,
>
> Data sharing is very likely part of the phenomenon:
>
> 	set mainList to {"a"}
>
> 	set displayList to {}
> 	set displayList to the mainList
> 	set beginning of displayList to "----"
>
> 	mainList
> 	--> {"----", "a"}
>
> In fact, "Set displayList to {}" is un-needed, since it is immediately overridden by the subsequent instruction.
>
> On the other hand, should you want to avoid data sharing, you may use "copy", as in:
>
> 	copy mainList to displayList
>
> HTH,
> Axel
> _______________________________________________
> 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


 _______________________________________________
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: ListWillNotEmpty
      • From: 2551 <email@hidden>
References: 
 >ListWillNotEmpty (From: "DigitEL @ Shaw" <email@hidden>)
 >Re: ListWillNotEmpty (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Some Way to Run an AppleScript from an ExtendScript Command?
  • Next by Date: Re: Some Way to Run an AppleScript from an ExtendScript Command?
  • Previous by thread: Re: ListWillNotEmpty
  • Next by thread: Re: ListWillNotEmpty
  • Index(es):
    • Date
    • Thread