Re: Creating list references in handlers. Bad code or bug?
Re: Creating list references in handlers. Bad code or bug?
- Subject: Re: Creating list references in handlers. Bad code or bug?
- From: Jon Pugh <email@hidden>
- Date: Sun, 16 Sep 2001 15:19:48 -0700
At 4:19 PM -0400 9/16/2001, Victor Yee wrote:
>
Hmmm, is this a bug?
>
>
set x to {1, 2}
>
set end of x's contents to 3
>
x
>
--> {1, 2}
No, "end" is not the last item, it's the position after the last item, and it's used for appending items onto a list.
For example:
set x to {1, 2}
set end of x to 3
x
--> {1, 2, 3}
If you want to change the last item, do this:
set x to {1, 2}
set last item of x to 3
x
--> {1, 3}
I don't see a bug, except perhaps that end of x's contents (which is equivalent to contents of end of x) doesn't error.
Jon