Here's something that doesn't work:
Code: Select all
function foo()
return 1, 2, 3
end
two = {foo()}[2]
Code: Select all
function foo()
return 1, 2, 3
end
two = {foo()}[2]
Code: Select all
local two = select(2, foo())
Code: Select all
local function foo()
return "a", "b", "c"
end
local table1 = { select(2, foo()) }
local table2 = { (select(2, foo())) }
print(#table1, #table2) -- prints 2, 1
Code: Select all
function foo()
return 1, 2, 3
end
res = {foo()}
two = res[2]
print (two)
Code: Select all
two = ({foo()})[2]
Code: Select all
_, two = foo()
Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest