Jump to content




returning a table


  • You cannot reply to this topic
4 replies to this topic

#1 SpencerBeige

  • Members
  • 263 posts

Posted 30 December 2014 - 12:27 AM

trying to use return function to return a table

#2 valithor

  • Members
  • 1,053 posts

Posted 30 December 2014 - 12:33 AM

View Postslow-coder, on 30 December 2014 - 12:27 AM, said:

-snip

A few examples of returning a table from a function

function func1()
  return {"entry1","entry2"}
end

func1table = func1()



tbl = {"entry1","entry2"}
function func2()
  return tbl
end
func2table = func2()
  

I know my variable names are extremely descriptive.

Edited by valithor, 30 December 2014 - 12:47 AM.


#3 SpencerBeige

  • Members
  • 263 posts

Posted 30 December 2014 - 12:37 AM

thx

#4 SpencerBeige

  • Members
  • 263 posts

Posted 30 December 2014 - 12:51 AM

wuht about reading a table from an api?

#5 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 30 December 2014 - 02:59 AM

What do you mean by "reading a table"? If you mean returning a table, exactly the same way. Just make a function in your api that returns the table.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users