Dice Posted August 19, 2013 Share Posted August 19, 2013 example tab = { { "nme", "text"}, { "nme2", "text2"}, { "nme3", "text3"} } I want to print nme, txt for each table. Link to comment
DNL291 Posted August 19, 2013 Share Posted August 19, 2013 outputChatBox(tab[1][1]) --> nme outputChatBox(tab[1][2]) --> text outputChatBox(tab[3][2]) --> text3 Link to comment
Dice Posted August 19, 2013 Author Share Posted August 19, 2013 yeah I know that method but the thing is, I am using table.insert so the sizes can vary, how can i make sure it gets it all. Link to comment
DNL291 Posted August 19, 2013 Share Posted August 19, 2013 What do you mean? You want to get all items of the table or what? Link to comment
Dice Posted August 19, 2013 Author Share Posted August 19, 2013 for i = 1,#tab do outputChatBox ( tab[i][1] .. " " .. tab[i][2] ) end Link to comment
Moderators IIYAMA Posted August 19, 2013 Moderators Share Posted August 19, 2013 for index1 = 1,#tab do local tabContents = tab[index1] local newString for index2 = 1,#tabContents do newString = tabContents[index2].. " " end if newString then outputChatBox(newString) end end You mean something like this? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now