Thread: I hate lua.
View Single Post
11-04-05, 03:01 PM   #3
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 1,935
The first question is.. what are you trying to accomplish.

The first example looks like you'd get the folllowing:

You have name, which you populate with numerically indexed names of the members in the raid. So if its you and I.. we'd be:

Code:
name = {[1] = "Cladhaire", [2] = "Shouryuu"]}
Then your code does something that I'm not understanding. You go through and set the table to the following:

Code:
name = {[1] = nil, [2] = nil};
Because name[v] doesn't have a value. if you're looking to make a double-reverse-lookup table, you can use:

Code:
function SetTicketNumberToNil()
	for k,v in name do
		name[v]=name[k]
	end
end
But I'm not sure exactly what you're looking for. My code would give you:

Code:
name = {
[1] = "Cladhaire",
[2] = "Shouryuu",
["Cladhaire"] = 1,
["Shouryuu"] = 2,
};

Last edited by Cladhaire : 11-04-05 at 03:05 PM.
  Reply With Quote