Re: Snippet to remove an item from a list
Re: Snippet to remove an item from a list
- Subject: Re: Snippet to remove an item from a list
- From: Arthur J Knapp <email@hidden>
- Date: Mon, 09 Jul 2001 10:30:05 -0400
>
Date: Sun, 8 Jul 2001 14:31:20 -0400
>
From: Victor Yee <email@hidden>
>
Subject: Re: Snippet to remove an item from a list
>
on insertIntoList(listRef, insertIndex, insertValue)
on InsertAt(lst, x, val)
if (x = 1) then
return {val} & lst
else if (x > lst's length) then
return lst & {val}
else
return lst's items 1 thru (x - 1) & ,
{val} & lst's items x thru -1
end if
end InsertAt
InsertAt({"a", "b", "c", "d", "e"}, 3, "z")
-- > {"a", "b", "z", "c", "d", "e"}
Arthur J. Knapp
http://www.stellarvisions.com
mailto:email@hidden
Hey, check out:
http://www.latenightsw.com/freeware/JavaScriptOSA/