Lingo Dictionary > D-F > deleteOne |  |

deleteOne

Syntax

    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.

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"].