View Single Post
04-18-09, 12:42 AM   #19
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
You can't check for a local variable outside it's block. You'd have to rename the global foo as something else and pass the data out to it.

Code:
function testfunction(frame)
    if not arg1 then 
        local foo = "foo"
        local bar = "bar"
        arg1 = foo
        arg2 = bar
    end
    text=arg1.. arg2
    DEFAULT_CHAT_FRAME:AddMessage(text)  -- test to make sure everything goes smoothly

local f = CreateFrame("FRAME", "Blah")
f:SetScript("OnUpdate", testfunction(self))

end
But that won't help your 60 upvalue any. For that, you're don't really have a choice but to condense it down via one of the previously mentioned methods.

Last edited by Sythalin : 04-18-09 at 12:43 AM. Reason: code typo