Hamatora Posted June 12, 2017 Share Posted June 12, 2017 (edited) Suppose I created a table, and inserted 8 fields into it. Now I wish to remove the 3rd field how can I? Like this: mytable = { {"1"}; {"2"}; {"3"}; {"4"}; {"5"}; {"6"}; {"7"}; {"8"}; } Edited June 12, 2017 by Hamatora Link to comment
PeaceBomb99 Posted June 12, 2017 Share Posted June 12, 2017 https://www.tutorialspoint.com/lua/lua_tables.htm https://en.wikibooks.org/wiki/Lua_Programming/Tables http://lua-users.org/wiki/TablesTutorial http://www.troubleshooters.com/codecorn/lua/luatables.htm Literally everything explained on these websites Link to comment
Scripting Moderators thisdp Posted June 12, 2017 Scripting Moderators Share Posted June 12, 2017 (edited) table.remove(mytable,3) Edited June 12, 2017 by thisdp Link to comment
Hamatora Posted June 13, 2017 Author Share Posted June 13, 2017 And what if I want to edit the field? Link to comment
pa3ck Posted June 13, 2017 Share Posted June 13, 2017 (edited) You can just set the value of that index like: myTable[3][1] = 'New Value' Edited June 13, 2017 by pa3ck 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