function Initialize()
a={}
for i=1,100 do
a[i] = ''
end
a = SetValues()
end
function Update()
end
function SetValues()
b = {}
for i=1,100 do
b[i] = i
end
return b
end
to where I can set an entire table/array to another using a return??! I have no idea why this isn't working, it seems like it should.
Last edited by revolt4peace on March 2nd, 2015, 8:13 pm, edited 1 time in total.
-__--__-- Explodingcreeperssss --__--__- Click Me! - My Algebra Solver for Rainmeter!
Whelp, i found another way to do it, so that's okay. My only problem now is that the original array seems to become a constant or something; every time it changes it messes up the code. Any idea?
-__--__-- Explodingcreeperssss --__--__- Click Me! - My Algebra Solver for Rainmeter!
Maybe try to move the code from the Initialize() to the Update() function. The Initialize() is executed just once on skin refresh, while the Update() is executed on every update of the skin.
function SetValues(i)
b = {}
for j=1,100 do
b[j] = j
end
return b[i]
end
In addition to what balala said, that's also horribly inefficient. By the time Initialize() is done, you'd have completely repopulated 'b' 100 times exactly the same way each time to return only a single value each time (10,000 assignments to return 100 values). I realize that this is a very basic framework so I can't tell what your end-purpose is, but generally that's not a good way to do it. If you're going to hard-code the values for 'b', put that in Initialize first so you can just assign a=b directly when you need it.