If i use
group:remove( array[u] )
array[u] = nil
for deleting it from the array and from the group, i get this:
start array count: 43
deleting u: 40
deleting u: 42
final array count: 39
How is that possible? if I just delete 2, why the array go from 43 to 39 (-4)?
Thanks.
PS: if i use table.remove(array,u) I get this error:
…sers\tigreton\docume~1\corona~2\sandbox\9\engine.lua:742: attempt to
index field ‘?’ (a nil value)
742 is:
print("start array count: " … #array)
or
for u=1, #array, 1 do
print("start array count: " .. #array)
for u=1, #array, 1 do
if array[u].option == true then
--group:remove( array[u] )
--array[u] = nil
--table.remove(array, u)
--array[u] = nil
print("deleting u: " ..u)
end
end
print("final array count: " .. #array)
[import]uid: 116842 topic_id: 29576 reply_id: 329576[/import]
[import]uid: 116842 topic_id: 29576 reply_id: 118839[/import]