|
Luis Carvalho wrote:
if ((not disp) or (table.getn(disp)==0)) then do stuff endin Lua 5.1 becomes if not disp or not next(disp) then -- do stuff end andfor i,d in disp do do things endbecomes for i,d in pairs(disp) do -- do stuff end or for i,d in next, disp do -- do stuff end Cheers, luis.
Thanks. For some reason 5.0 accepts the (not disp and not next(disp)), but it still doesn't like the alternatives in the for statement. Recognizes that they are valid calls, but still says it is expecting a table value for disp but that disp is nil. Odd thing is that it gives this error even if the table has a value.