ID:147769
 
I'm trying to loop through a list full of objs and manipulate them.

In this case, I need to delete each one slowly.
        Del()
for(var/i=0;i<trails.len;i++)//trails is defined as trails[]=new list()
world<<"deleting trail number[i]"
var/obj/O=trail[i]
// del(O)
world<<"deleted trail number[i]"
sleep(sleeptime)//amount to sleep before deleting next obj
..()

here is the code
the Del() proc is acting odd, meaning var/obj/O is giving me an "index out of bounds error", and it keeps outputing deleting trail number 0, and this is a Del() under an obj proc. I would appreciate help on this, thanks.

~~Coolroman123~~
Simple, you're trying to manipulate them after they've been deleted from the list. And, the length of the list is still the same, because it's not like contents where it removes the null spaces. You must remove the null spaces your self.
In response to Goku72
Thank, Goku72. I found out the problem.