DELETE v11
The DELETE
method deletes entries from a collection. You can call the DELETE
method in three different ways.
Use the first form of the DELETE
method to remove all entries from a collection:
Use the second form of the DELETE
method to remove the specified entry from a collection:
Use the third form of the DELETE
method to remove the entries that are within the range specified by first_subscript
and last_subscript
(including the entries for the first_subscript
and the last_subscript
) from a collection.
If first_subscript
and last_subscript
refer to non-existent elements, elements that are in the range between the specified subscripts are deleted. If first_subscript
is greater than last_subscript
, or if you specify a value of NULL
for one of the arguments, DELETE
has no effect.
Note that when you delete an entry, the subscript remains in the collection; you can re-use the subscript with an alternate entry. If you specify a subscript that does not exist in the call to the DELETE
method, DELETE
does not raise an exception.
The following example demonstrates using the DELETE
method to remove the element with subscript 0
from the collection:
COUNT
indicates that before the DELETE
method, there were 5
elements in the collection; after the DELETE
method was invoked, the collection contains 4
elements.