User Guide
deleteProp 291
deleteOne
Usage
list.deleteOne(value)
deleteOne list, value
Description
List command; deletes a value from a linear or property list. For a property list, deleteOne also
deletes the property associated with the deleted value. If the value appears in the list more than
once,
deleteOne deletes only the first occurrence.
Attempting to delete a property has no effect.
Parameters
value
Required. The value to delete from the list.
Example
The first statement creates a list consisting of the days Tuesday, Wednesday, and Friday. The
second statement deletes the name Wednesday from the list.
days = ["Tuesday", "Wednesday", "Friday"]
days.deleteOne("Wednesday")
put days
The put days statement causes the Message window to display the result:
-- ["Tuesday", "Friday"].
deleteProp
Usage
list.deleteProp(item)
deleteProp list, item
Description
List command; deletes the specified item from the specified list.
• For linear lists, replace item with the number identifying the list position of the item to be
deleted. The
deleteProp command for linear lists is the same as the deleteAt command. If
the number is greater than the number of items in the list, a script error occurs.
• For property lists, replace item with the name of the property to be deleted. Deleting a
property also deletes its associated value. If the list has more than one of the same property,
only the first property in the list is deleted.
Parameters
item Required. The item to delete from the list.
Example
This statement deletes the color property from the list [#height:100, #width: 200, #color: 34,
#ink: 15], which is called spriteAttributes:
spriteAttributes.deleteProp(#color)
The result is the list [#height:100, #width: 200, #ink: 15].