in reply to Deleting internal array elements
You will need a scalar counter to keep track of the number of valid elements, and if that hits zero, you are done.