Product SiteDocumentation Site

5.3.12.10. delete


>>-delete(---index--)------------------------------------------><

Returns and deletes the member item with the specified index from the queue. If there is no item with the specified index, the Nil object is returned and no item is deleted. All elements following the deleted item will be moved up in the queue ordering and the item indexes will adjusted for the deletion. The size of the collection will be reduced by 1 element. The delete method and the remove method produce the same result for the list class.

Example 5.169. Queue class - delete method

   a = .queue~of("Fred", "Mike", "Rick", "David")
   a~delete(2)  -- removes "Mike", resulting in the queue
                -- ("Fred", "Rick", "David")