View Single Post
01-23-14, 05:14 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Isn't that what you should be doing anyway?

I mean, this is the documentation I found on using "#" with select, anyway" of wowpedia.
Lua Code:
  1. local num = select('#', ...) -- Returns the number of arguments in the ellipsis.

You have a table there instead of a vararg. The number of arguments there in that case would be one.

I always had an aversion to using select() anyway. I would do that this way:
Lua Code:
  1. local events = {
  2.      "EVENT_ONE",
  3.      "EVENT_TWO",
  4.      "EVENT_THREE"
  5. }
  6.  
  7. for k,v in pairs(events) do
  8.      myFrame:RegisterEvent(v)
  9. end
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote