Articles Archive
Director Forums
Director Wiki
Job Board
Search
 
 Director Online WikiMain Page | About | Help | FAQ | Special pages | Log in | Printable version | Disclaimers

DeleteAt

From Director Online Wiki

list.deleteat(index)
deleteat list, index

List command; deletes an item from a linear or property list at the specified position. The position is stated as a number, even for property lists. Only works with linear lists and property lists; other data types will generate an error.

Example

This example creates a list, then deletes an element from the list, then displays it.

samplelist = [#a, #b, #c, #d]
samplelist.deleteat(2)
put samplelist

displays:

    --"[#a, #c, #d]"

This example deletes an item from a property list. Notice that even though it's a property list, the item to be deleted with deleteAt() is a numeric index:

samplePropList = [#a:100, #b:200, #c:300, #d:400]
samplePropList.deleteat(2)
put samplePropList 

displays:

--"[#a:100, #c:300, #d:400]"

Retrieved from "http://www.director-online.com/dougwiki/index.php/DeleteAt"

This page has been accessed 550 times. This page was last modified 22:36, 2 Nov 2006.