UP VALUES

I received an error message:  function at line 3033 has more than 60 up values.

Line 3033 is :


–SCENE SHOW


function scene:show( event )

Does this mean i have too many calculations going on in scene Show?

If so, would I need to break them into modules?

Thanks

Lori

Upvalues are kinda hard to explain, but basically any given function in Lua can only access up to 60 variables declared above it.  For instance:

local a1, a2, a3 … a60, a 61

local function someFunction()

    a1 = 1; a2 = 2; … a61 = “fred”

end

Generally if you have too many variables it’s time to put them into a table so it’s only one upvalue.  See this other forum thread:
 

http://forums.coronalabs.com/topic/43060-handling-more-than-60-up-values-in-createscene-function/

Rob

Thanks!   I’ll check out the forum thread.

Lori

Upvalues are kinda hard to explain, but basically any given function in Lua can only access up to 60 variables declared above it.  For instance:

local a1, a2, a3 … a60, a 61

local function someFunction()

    a1 = 1; a2 = 2; … a61 = “fred”

end

Generally if you have too many variables it’s time to put them into a table so it’s only one upvalue.  See this other forum thread:
 

http://forums.coronalabs.com/topic/43060-handling-more-than-60-up-values-in-createscene-function/

Rob

Thanks!   I’ll check out the forum thread.

Lori