Code: Select all
ForEach(table, function (index, value)
if something, as example, value=searcheditem then removeitem(table, index)
endfunction)
Code: Select all
t_temptable = {}
ForEach(table, function (index, value)
if something, as example, value=searcheditem then insertitem(t_temptable, index)
endfunction)
Code: Select all
ForEach(t_temptable, function (index, value)
removeitem(table, value)
endfunction)
It could be something like ForEachCopy(), or even additional argument, as right now arguments are ForEachCopy(table, function) it could be ForEachCopy(table, function, copy) where copy would be True or False.
Meaning that it would inside hollywood make a copy of that table and then go through that copy instead of the original, but when using removitem (or similarly table affecting commands) it would instead of affecting the copy that it is going through, will be using that command to the original table.
And naturally after foreach is done, that copy would automatically be destroyed.