How do I copy a table? I tried various solutions on the net for lua but none seemed to work in mudlet. (I didn't get an error message in the debug window either :/ )
On that note, the table.* functions didn't seem to work either. Like table.foreach, table.sort, table.concat .. am I doing something wrong or is there a reason for that? And how do you sort a table then?
Copy a table?
Re: Copy a table?
Right, ignore me. The copy problem was entirely my fault.
I'm still curious about the table.* functions though, if anyone knows.
I'm still curious about the table.* functions though, if anyone knows.
Re: Copy a table?
Code: Select all
t = { 3,2,5,1,4}
display(t)
t = table.sort(t)
display(t)
Code: Select all
t = { 3,2,5,1,4}
display(t)
t = t:sort()
display(t)