Re: OS 9.1 broke (items 1 thru 0 of theList)
Re: OS 9.1 broke (items 1 thru 0 of theList)
- Subject: Re: OS 9.1 broke (items 1 thru 0 of theList)
- From: "Arthur J Knapp" <email@hidden>
- Date: Mon, 15 Jan 2001 11:22:22 -0500
>
Date: Sat, 13 Jan 2001 09:50:00 -0600
>
Subject: OS 9.1 broke (items 1 thru 0 of theList)
>
From: JollyRoger <email@hidden>
>
The following works fine on every system version except OS 9.1:
>
set myList to {"item 1", "item 2", "item3", "item 4"}
>
return RemoveListItem(1, myList)
>
on RemoveListItem(x, theList)
>
set newList to (items 1 thru (x - 1) of theList) &
I think your subject line says it all. :)
"items 1 thru 0" is nonsensical, and I think Apple is probably within it's
rights to discontinue it's use.
>
I now have to add another if/then clause if I expect my scripts to run on OS
>
9.1:
>
>
if x = 1 then
>
set newList to (items 2 thru -1 of theList)
Actually, you can shaved off some milliseconds by using the
syntax:
set newList to rest of theList
Here is my handler, (I don't use as much parameter testing as
you do, I generally call this handler inside of try-statements) :
on ItemDelete(lst, x)
if (x = 1) then
return lst's rest
else if (x = lst's length) then
return lst's items 1 thru -2
else
return (lst's items 1 thru (x - 1)) & ,
(lst's items (x + 1) thru -1)
end if
end ItemDelete
>
I would like to know if this change was made on purpose or if this is a bug?
There are some "bugs" that turn out to be very useful, but you can
never be sure if an update is going to make them disappear. :(
--
{
Arthur J Knapp, of STELLARViSIONs ;
http://www.STELLARViSIONs.com ;
mailto:email@hidden ;
"...it's not my birthday,
it's not today..."
}