Error 'attempt to concatenate global'
ok I am getting this error in my addon
Quote:
Code:
debugLog = "DEBUG: Spell ID:" .. SID; any help? |
Prior to that line add the following :
print("DEBUG: Spell ID:",SID); Then see what it shows in your chat window. Maybe it is getting to that line prior to the OnLoad call. You can test this by setting SID at the top of your lua file it is used in and set it to a value there. |
Don't create a global named SID. Put it in a namespace or make it local. Calling a global that is just asking for some other addon to overwrite it.
Also, what Xrystal said. :) |
Quote:
OK i found the issue, I was assigning its value from UnitBuff() and passing it the spell id, however it doesn't always have a value for spell id. So I created a function to check the value and if it was nil then I assigned it "none" and that fixed it. Also, I only made it a global variable because I was trying to get rid of the error. I have made it local again. |
Quote:
Code:
debugLog = "DEBUG: Spell ID:" .. SID or "none" Code:
foo = foo and bar or lol and boo or bar == boo and nil Code:
local foo = nil |
Quote:
Edit: Just to make sure, I ran this through Lua and it works as I had described. |
Quote:
Code:
print(type(foo)=="table" and foo.bar or "LOL") |
Quote:
|
All times are GMT -6. The time now is 03:02 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI