View Single Post
04-30-14, 10:31 PM   #48
cokedrivers
A Rage Talon Dragon Guard
 
cokedrivers's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 325
Originally Posted by Phanx View Post
You don't. There is literally no difference whatsoever between "for i = 1, 10 do" and "for i = 1, 10, 1 do".

Also:

While it doesn't really matter, you should use variable names that make sense. A variable like "buttonName" should logically contain the name of a button, not the button object itself.

Rather than doing more string concatenations and global lookups )eg. _["ThisBarButton"..i.."Icon"]) you should use the keys on the button that already point to those things (eg. button.icon).

Don't forget to call ClearAllPoints before you start calling SetPoint -- otherwise you may end up with unexpected results if the original region was positioned with points other than the ones you're setting.

Avoid duplicating code. If you're going to use the same chunk of code in 5 different places, factor it out into a function, and just call the function from those 5 places.

http://pastebin.com/WEGEz70y
Your code works perfect like normal.

Thank You
Coke
  Reply With Quote