Please tell me there is SOME easier way to do this??
table.delitem
table.delitem
What this does: Searches ipairs for a string, then deletes all the keys that == string. I need to do this in quite a number of scripts. It works just as well for one value that matches as for 20.
Re: table.delitem
Might want not want to use the keyword 'string' as the argument/variable.
Re: table.delitem
Fixed that up so it -would- run... but still doesn't do what I wanted quite >.> I was getting the function to remove -all- of the the specified string. This will just do the first one, then end the function.
In order to remove them all, you gotta do it from the last key to remove to the first, otherwise you alter where the thing is in the table by removing the first, which makes you remove the wrong key when you try to remove the second, etcetera.
In order to remove them all, you gotta do it from the last key to remove to the first, otherwise you alter where the thing is in the table by removing the first, which makes you remove the wrong key when you try to remove the second, etcetera.
It did show me how to use assert proper though... wasn't able to get it to work before. With assert instead of if then else error end,