View Single Post
04-17-09, 07:20 AM   #3
Azul
Banned
 
Azul's Avatar
Join Date: Apr 2009
Posts: 19
Originally Posted by Cargor View Post
Never encountered your message, but it seems like you're using a lot (over 60) of local variables which are then accessed by your OnUpdate-function which causes trouble.

As you create a lot of frames, you could try to store them in tables rather than locals - this would basically eliminate a lot of your upvalues as you're only accessing one in your function(the table).

In general, it would be more helpful to see some of your code or a description how you're creating/storing the frames.
Thanks.

There is just one frame, for the OnUpdate function. It's a command based addon.

Also, arrays and globals are to slow and use to much meory.. and locals in the OnUpdate function lose all of their data on each frame.. so I need to know how to do it this way, with more then 60. Please help.


Here is some pseudo code;
Code:
local Var,AnotherVar,Foo,Bar,Etc=1,"blah blah blah",GetTime(),nil
local frame=CreateFrame("Frame")

frame:SetScript("OnUpdate",function(self)

some stuff that uses Var
some stuff that uses AnotherVar
some stuff that uses Foo
some stuff that doesn't use any of them
some stuff that uses Bar
some stuff that uses Etc

end)

SlashCmdList["somecmd"] = function (arg1)
	if Etc then
		Etc=nil
	else
		Etc=1
	end
end
SLASH_somecmd1="/justacmd"
SlashCmdList["anothercmd"] = function (arg1)
	AnotherVar=arg1
end
SLASH_anothercmd1="/justanothercmd"
In this little example there are 5 variables used. If I use a lot then I get the error and it won't run.

Last edited by Azul : 04-17-09 at 07:36 AM.