View Single Post
05-04-08, 01:24 AM   #10
Shirik
Blasphemer!
Premium Member
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2007
Posts: 818
Originally Posted by Slakah View Post
I think the second method is moderately faster.
Yes, the second method is faster, though it should be pointed out that you should use the standard name _G, not the lowercase g you used, just to follow convention. Similarly, you should use the Blizzard-supplied _G available. To localize it, just do "local _G = _G"

Originally Posted by Slakah View Post
Then to say hide the frame do.

Code:
 frames.1:Hide()
This is illegal. You meant
Code:
frames[1]:Hide()
You also run into the problem of "what if they have more than 7 chat tabs?" Your best way of doing it would be:

Code:
local _G = _G
local x = 0;
repeat
   x = x + 1;
   local this = _G["ChatFrame"..x];
   if this then this:Hide() end;
until not this
__________________
たしかにひとつのじだいがおわるのお
ぼくはこのめでみたよ
だけどつぎがじぶんおばんだってことわ
しりたくなかったんだ
It's my turn next.

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