View Single Post
02-01-08, 10:13 AM   #4
Shirik
Blasphemer!
Premium Member
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2007
Posts: 818
Originally Posted by ProfOak View Post
-- set the trigger to catch the event and call your function
frame:SetScript("OnEvent", function(this, event, ...)
MyAddon[event](MyAddon, ...) end; );
While there's nothing wrong with what you did, I strongly advise that you use "self" instead of "this" when making these types of functions. This fits the standard Lua syntax, and you'll get less confusion when others are reading your code (and may save yourself some confusion as well).
__________________
たしかにひとつのじだいがおわるのお
ぼくはこのめでみたよ
だけどつぎがじぶんおばんだってことわ
しりたくなかったんだ
It's my turn next.

Shakespeare liked regexes too!
/(bb|[^b]{2})/
  Reply With Quote