How can I completely clear or flush a table in Lua. I want to do this in an empty table at the end.
You iterate over the keys and make them zero.
for k,v in pairs(t) do t[k] = nil end
If it is an array, then delete the values using table.remove ()
How about this way?
t = {..some non-empty table..} ...some code... t={}
this will create a new table 't' with a new pointer and delete the old values:
t = {1, 2, 3} t = {} collectgarbage()
this element will delete all table values and you will not get any table:
t = {1, 2, 3} t = nil collectgarbage()
Source: https://habr.com/ru/post/1791124/More articles:Comparison of HTML5 Canvas 2D and NaCl pp :: Graphics2D (performance) - html5how to fix error when inserting datatime in db - javaCfreport error for ColdFusion when format is superior - coldfusionRouting help .net mvc - asp.netкак оценить (мощность сигнала на заданной частоте) по сравнению с временем в питоне - pythonChange dynamic video playback speed in Flash - flashПроблема с транзакцией - javaFast Forward Flash Video - performanceExtract multidimensional cookie values using JavaScript - javascriptWPF TreeView. How to update a tree after adding / removing a node? - c #All Articles