WoW:API wipe: Difference between revisions

No change in size ,  6 September 2009
Example first since it's simpler, lays foundation for concepts in Notes
(→‎Notes: naming a variable 'table' was just brilliant.)
(Example first since it's simpler, lays foundation for concepts in Notes)
Line 10: Line 10:
== Returns ==
== Returns ==
:; table : Table - The empty table.
:; table : Table - The empty table.
== Example ==
local tab = {}
tab.Hello = "Goodbye"
print(tab.Hello) -- print "Goodbye"
tab = table.wipe(tab)
print(tab.Hello) -- print nil


== Notes ==
== Notes ==
Line 29: Line 36:
  assert(#copy2==0)    -- the copy is expectedly empty,
  assert(#copy2==0)    -- the copy is expectedly empty,
  assert(#data==0)    -- and so is the original table.
  assert(#data==0)    -- and so is the original table.
== Example ==
local tab = {}
tab.Hello = "Goodbye"
print(tab.Hello) -- print "Goodbye"
tab = table.wipe(tab)
print(tab.Hello) -- print nil




{{LUA}}
{{LUA}}
Anonymous user