This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
darkhenmore's profile picture

Return multiple

Started by darkhenmore, 14 April 2013 - 12:21 AM
darkhenmore #1
Posted 14 April 2013 - 02:21 AM
Hi,
Is it possible to return multiple variables from a function?
remiX #2
Posted 14 April 2013 - 02:29 AM
Yes,

return value1, value2, value3
Jan #3
Posted 14 April 2013 - 02:29 AM
Yes it is.
seperate the variables with commas. for example:

local function hello()
return "hello","world"
end
local a,b = hello()
print(B)/>
darkhenmore #4
Posted 14 April 2013 - 02:45 AM
Well that was simple, thanks!