Re: applescript-users digest, Vol 2 #1109 - 9 msgs
Re: applescript-users digest, Vol 2 #1109 - 9 msgs
- Subject: Re: applescript-users digest, Vol 2 #1109 - 9 msgs
- From: email@hidden
- Date: Tue, 25 Sep 2001 19:14:25 GMT
Checking my mail after vacation, I looked at this and don't see
the bugs claimed in the attached messages. Try it with an additional
variable y as shown below and you will see that AppleScript does
exactly what it is supposed to do.
Regards,
Bob Anderson
------------------------
set x to {1, 2}
set y to x's contents
set end of y to 3
{x, y}
--> {{1, 2}, {1, 2, 3}}
------------------------
>
Message: 1
>
Date: Sun, 16 Sep 2001 16:19:46 -0400
>
From: Victor Yee <email@hidden>
>
Subject: Re: Creating list references in handlers. Bad code or bug?
>
To: applescript-users <email@hidden>
>
>
Hmmm, is this a bug?
>
>
set x to {1, 2}
>
set end of x's contents to 3
>
x
>
--> {1, 2}
>
>
>
Message: 8
>
Date: Sun, 16 Sep 2001 15:19:48 -0700
>
To: Victor Yee <email@hidden>, applescript-users
>
<email@hidden>
>
From: Jon Pugh <email@hidden>
>
Subject: Re: Creating list references in handlers. Bad code or bug?
>
>
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
Victor
---------------------------------------------
Meganet Communications - Internet the way it should be.
http://www.meganet.net/