• 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: List Question: Can someone explain this to me?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: List Question: Can someone explain this to me?


  • Subject: Re: List Question: Can someone explain this to me?
  • From: email@hidden (Michael Sullivan)
  • Date: Thu, 13 Jun 2002 12:02:47 -0400
  • Organization: Society for the Incurably Pompous

> I have a script which creates two lists from one piece of data. The lists
> are called Artwork and ProductCode

> The script then goes through each item in Artwork and precedes it with
> "Studio:Artwork:Lineart:"

> For some reason that has been driving me mad all day, this change is also
> reflected in the ProductCode list.

You've discovered the difference between set and copy.

When you absolutely, positively need to make sure the information gets
duplicated, and that you aren't passing a reference, use copy, not set.

Set will often copy the data rather than a reference, but not always.
it depends on the complexity of the data. Copy can take a long time on
large data structures. The rule is basically, use set for speed, copy
for security.

It looks like set will pass a reference for lists or records, but not
for strings or numbers.


Michael

--
Michael Sullivan
Business Card Express of CT Thermographers to the Trade
Cheshire, CT email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: List Question: Can someone explain this to me?
  • Next by Date: Re: can I do this better?
  • Previous by thread: Re: List Question: Can someone explain this to me?
  • Next by thread: Re: List Question: Can someone explain this to me?
  • Index(es):
    • Date
    • Thread