Re: Variable Ponderance
Re: Variable Ponderance
- Subject: Re: Variable Ponderance
- From: Michelle Steiner <email@hidden>
- Date: Thu, 30 Sep 2004 10:40:03 -0700
On Sep 30, 2004, at 10:27 AM, Ben Waldie wrote:
In the first example, I pass down a variable containing a number,
completely change it to a value of 2, and the variable at the top
level of my script behaves as I would expect, retaining its original
value. In the second and third examples though, I pass down a
variable containing a list or a record, modify part of the list or
record, and the variable at the top level of my script does not behave
as I would expect. In these 2 cases, the main script treats the
variable as it if is a global, remembering the change I made in the
handler. This appears to occur only when manipulating the variable,
and not when changing it completely. Is this the intended behavior?
It is analogous to the difference between set and copy.
set x to {1, 2, 3}
set y to x
set item 2 of y to 9
return x
--> {1, 9, 3}
set x to {1, 2, 3}
copy x to y
set item 2 of y to 9
return x
--> {1, 2, 3}
--
If you don't hit any bumps in the road, you're not moving.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden