Re: set vs copy?
Re: set vs copy?
- Subject: Re: set vs copy?
- From: "Mark J. Reed" <email@hidden>
- Date: Tue, 14 Sep 2010 19:51:45 -0400
set A to {1,2,3}
set B to A
copy A to C
set end of A to 4
set end of B to 5
set text item delimiters to ","
log("A is " & A as text)
log("B is " & B as text)
log("C is " & C as text)
Result:
A is 1,2,3,4,5
B is 1,2,3,4,5
C is 1,2,3
A and B are both pointing to a single list; changing that list,
whether you go through A or B, results in a change visible through
both. C is a separate copy of that list made when it only had 3
elements, unaffected by subsequent modifications to the original. You
can, of course, now go and modify C, and it won't affect A or B.
_______________________________________________
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