Code:
function Acrobot_SubChecker(msg)
local SubStatus = nil
local UnconvertedAcro = msg
DEFAULT_CHAT_FRAME:AddMessage("Unconverted Acro:" .. UnconvertedAcro) --This successfully displays the phrase being passed to the function
local ConvertedAcroTable = {}
for part in string.gmatch(UnconvertedAcro, "%a+") do
AbbreviatedAcro = string.sub(part, 1, 1)
table.insert(ConvertedAcroTable, AbbreviatedAcro)
end
ConvertedAcroString = table.concat(ConvertedAcroTable)
DEFAULT_CHAT_FRAME:AddMessage(ConvertedAcroString .. " " .. Acrobot_CreateAnswer("current")) --This is where it fails with the error "attempt to concatenate a nil value"
if string.lower(ConvertedAcroString) == Acrobot_CreateAnswer("current") then
SubStatus = "Accepted"
return SubStatus
elseif string.lower(ConvertedAcroString) ~= Acrobot_CreateAnswer("current") then
SubStatus = "Rejected"
return SubStatus
end
end
The code I pasted above is intended to take a phrase and convert it into an acronym. For example, the phrase "Demeth likes WoWInterface" would become "dlw". However, it's refusing to work, and I'm out of ideas.
This is my first "real" addon by the way.