lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


>     for k,v in pairs(effectsTable[widgetTableIndex]) do
>                   print(k,v)
>                   local alive = coroutine.resume(v)
>
>                    if (not alive) then
>                        v = nil;

This line here is wrong. You cannot change v because it's not the same variable. Well, you CAN change v, but it's not what you want to do. v is a reference to the value that's in the table. It is NOT a pointer to the position in that table.

You want t[k] = nil

This modifies the table, whereas "v = nil" just modifies some local variable you currently have, that will soon be discarded.

>                    break;
>                    end;
>               end
>

Regards,
-- Matthew P. Del Buono a.k.a. Shirik