OS 9.1 broke (items 1 thru 0 of theList)
OS 9.1 broke (items 1 thru 0 of theList)
- Subject: OS 9.1 broke (items 1 thru 0 of theList)
- From: JollyRoger <email@hidden>
- Date: Sat, 13 Jan 2001 09:50:00 -0600
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)
-- removes any item from a list
set x to (x as number)
if x < 1 then return theList
set numItems to count of items in theList
if numItems is 1 then return {}
if x > numItems then return theList
if x = numItems then
set newList to (items 1 thru -2 of theList)
else
set newList to (items 1 thru (x - 1) of theList) & (items (x + 1)
thru -1 of theList)
end if
return newList
end RemoveListItem
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)
I would like to know if this change was made on purpose or if this is a bug?