Jump to content




Return multiple


3 replies to this topic

#1 darkhenmore

  • Members
  • 16 posts

Posted 14 April 2013 - 01:21 AM

Hi,
Is it possible to return multiple variables from a function?

#2 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 14 April 2013 - 01:29 AM

Yes,

return value1, value2, value3


#3 Jan

  • Members
  • 141 posts
  • Locationthe Netherlands

Posted 14 April 2013 - 01: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)/>


#4 darkhenmore

  • Members
  • 16 posts

Posted 14 April 2013 - 01:45 AM

Well that was simple, thanks!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users