Just checking to make sure.
If I do:
Code: Select all
for n = 0 to tableitems(mytable)-1
If mytable[n] = "toberemoved" then RemoveItem(mytable, n)
next
then that can cause problems, as for example, suppose index 2 and index 3 are both to be removed, then when removing n=2, the next, n=3, is actually going to be checking index 4, skipping index 3, since table was reconstructed when removeitem was done and index 3 is moved to index 2, to fill the empty spot after removal.
But if I do:
Code: Select all
for n = tableitems(mytable)-1 to 0 step -1
If mytable[n] = "toberemoved" then RemoveItem(mytable, n)
next
I suppose now it is completely safe, right? That nothing weird is happening here that would suddenly make it unsafe?