Got a small issue. I'm writing an addon for the guild, and I need a few things to happen only if you're logged in as an officer (Guild rank Index 0, 1 or 2). So I assumed I could do this:
local guildName, guildRankName, guildRankIndex = GetGuildInfo("player");
if (guildRankIndex =< "2") then
DEFAULT_CHAT_FRAME:AddMessage("You're an officer!")
... But no. I'm able to display guildRankIndex, and it will display 0 for the guildleader, 1 for officers and 2 for officer alts, so that's not the issue ... so why ain't I able to use it in an if-statement like that?
Is there a reason you're comparing to the string "2" instead of 2?
I've also never seen the comparison operator written as =< instead of <=
Not sure if it makes any difference to lua, but I'm guessing it won't like it if it's parsing tokens left to right.
Yep, according to this page http://www.wowwiki.com/API_GetGuildInfo guildRankIndex is an integer - not a string. So get rid of your quotes. Also, use <= instead of =< (I'm also not sure if it makes a difference, but you want everything to be correct ;) ).
And get BugGrabber/BugSack if you don't have them yet, and don't hide your errors in Interface Options. It will help you with things like this.
edit: glad you got it figured out. Still install the above.