Thread: I hate lua.
View Single Post
11-04-05, 11:07 PM   #8
Trimble Epic
An Aku'mai Servant
 
Trimble Epic's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 31
Lightbulb

here's how I would do what I think you're trying to do

Code:
function SetTicketNumberToNil(name)
	local new_name = {}  -- use a temporary table
	for k,v in name do -- iterate over every field in the table
		new_name[v]=k -- just stick 'em in the new table
	end
	table.setn(new_name,table.getn(name)) -- might not be needed, but you can do this to be thorough
	return new_name -- return the new table
end
  Reply With Quote