| |
Currently if you have two consecutive items, and ask tDeleteItem to remove them, it'll miss the second one (because it deosn't compensate for the removal of the first).
-- Table Utility Functions
function tDeleteItem(table, item)
local index = 1;
while table[index] do
if ( item == table[index] ) then
tremove(table, index);
else
index = index + 1;
end
end
end
X={1,2,3,3,4,5}
tDeleteItem(X, 3)
X={1,2,3,4,5}
X={1,2,3,4,3,5}
tDeleteItem(X, 3)
X={1,2,4,5}
> Use ## SavedVariables: instead of RegisterForSave()
|