'LinKin Posted March 1, 2014 Share Posted March 1, 2014 Hi, I've a table like this: myTable[1] = "1st Text" myTable[2] = "2nd Text" myTable[3] = "3rd Text" myTable[4] = "4th Text" myTable[5] = "5th Text" Then, I add the event onClientRender to show the message that is in the first position of the table. And after 5 seconds, I stop showing it. But, after these 5 seconds, I also want to 'delete' the first position of the table, and move the other positions of it. So it'd look like this: myTable[1] = "2nd Text" myTable[2] = "3rd Text" myTable[3] = "4th Text" myTable[4] = "5th Text" So, the question is, what would happen to the 5th position of the table? Would it still occupate a memory's space? Link to comment
Castillo Posted March 1, 2014 Share Posted March 1, 2014 No, it'll be gone as far as I know. Link to comment
'LinKin Posted March 1, 2014 Author Share Posted March 1, 2014 For example, if I do myTable[1] = nil and then I do table.insert(myTable, "some text"), would lua automatically place this in the 1st position of the table? Link to comment
WhoAmI Posted March 1, 2014 Share Posted March 1, 2014 table.remove(table, [pos]) -- position of value in table, for example 1'st position is 1st text Link to comment
Castillo Posted March 1, 2014 Share Posted March 1, 2014 It'll be placed last if I'm right. Link to comment
Bonsai Posted March 1, 2014 Share Posted March 1, 2014 You can also provide a position on table.insert. 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