lua-users home
lua-l archive

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


Just starting with lua and I wanted to test multiple return values from a function. I then ran into forward declaring issues (which I still am not clear on how it works), so I ended up with this code:

Code: [Select]
#!/usr/bin/lua

local func = function() end

b, c = func()

print(b, c)

local function func()
    return 10, 11
end

When I execute is, it prints nil nil for the b and c.

Do all functions need to be complete before I can call it in Lua?

Thanks!