View Single Post
12/16/23, 10:35 AM   #1
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 247
Question question regarding tables and number of entries

Im looking for a way to determine the number of entries on the fly for a chat multiiple event filter im working on for the "FOR" statement. Ive been getting errors stating its expecting a number with this setup.

Code:
MyAddon.killFilterList = {}

function MyAddon.PvpKillFeedFilter(victomDisplayName)--<< PVP CHAT FEED MULTIPLE EVENT FILTER
	for i = 1, MyAddon.killFilterList do
		if (nil == MyAddon.killFilterList[victomDisplayName]) then
			table.insert(MyAddon.killFilterList, victomDisplayName)
			return false
		end
	end
	return true
end
I'd like to to just scan the list and add entries theyre not present.

then later clear the list which I think I can do with "MyAddon.killFilterList = {}" but untested untill the 1st part is working.

Suggestions?
  Reply With Quote