Feche1320 Posted February 28, 2012 Share Posted February 28, 2012 For example, I have this: local table = { value1 = {}, value2 = {}, value3 = {} } for i = 1, math.random(9999, 99999) do table.insert(table, { value1 = math.random(1, 10), value2 = math.random(500, 1000), value3 = "wawawa" ..i }) end Now, how could I clear the table, leaving it empty again? Thanks! PD: That is an example. Link to comment
arezu Posted February 28, 2012 Share Posted February 28, 2012 local table = { value1 = {}, value2 = {}, value3 = {} } for i = 1, math.random(9999, 99999) do table.insert(table, { value1 = math.random(1, 10), value2 = math.random(500, 1000), value3 = "wawawa" ..i }) end -- makes the table to an empty table table = {} Link to comment
Feche1320 Posted February 28, 2012 Author Share Posted February 28, 2012 Hmm, isn't it like this? table = { value1 = {}, value2 = {}, value3 = {} } Or simply table = {} ? Link to comment
Cadu12 Posted February 28, 2012 Share Posted February 28, 2012 table = { value1 = {}, value2 = {}, value3 = {} } Link to comment
Kenix Posted February 28, 2012 Share Posted February 28, 2012 You can this: tTable = { value1 = { }; value2 = { }; value3 = { }; } Or this tTable = { } tTable.value1 = { } tTable.value2 = { } tTable.value3 = { } It same. You mean it? Or i not understand .. Link to comment
Feche1320 Posted February 28, 2012 Author Share Posted February 28, 2012 Okay , thanks! 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