Re: list question
Re: list question
- Subject: Re: list question
- From: Andrew Oliver <email@hidden>
- Date: Tue, 03 Jun 2003 10:35:16 -0700
The line:
set a's item 1 to "b"
Sets the first item in a to be the string value "b" since you enclosed "b"
in quotes.
If you'd:
set a's item 1 to b
You would set the item to the list object called b. However, Since b is a
reference to the same object a you get a stack overflow.
It isn't clear exactly what you expect to get out of this. I *think* what
you're trying to do is use b as a copy of the original, then manipulate the
original in which case you want to:
set a to {"a", 1}
copy a to b -- now b is a distinct copy of a
set a's item 1 to "b"
return b
--> {"a", 1}
And a still holds the modified {"b", 1}
Andrew
:)
>
set a to {"a", 1}
>
set b to a
>
set a's item 1 to "b"
>
return b
>
>
--> {"b", 1}
>
------------
>
>
>
but shouldn't b be {"a",1}? I'm running this in AS 1.6 on OS 9.2.2
>
>
Thanks.
>
>
Jay
>
_______________________________________________
>
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.
_______________________________________________
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.