Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
dataSaver problem with directory — Gideros Forum

dataSaver problem with directory

JackoJacko Member
edited August 2014 in General questions

local odliczanie_por_roku
local czas=0
local x=2
local czastimera=0
local jedynkowiec=0
Poryroku = Timer.new(1000, 13)
Poryroku:addEventListener(Event.TIMER, function(e)
local czas = dataSaver.loadValue("|D|somevalue")
czas=czas+jedynkowiec
czastimera=Poryroku:getCurrentCount()
jedynkowiec=czastimera/czastimera
dataSaver.saveValue("|D|somevalue", czas)
print("TIMER", Poryroku:getCurrentCount())
print("czas",czas)
end)
Poryroku:start()

--------------------------------------------------------------------------------


why when I'm changing "somevalue" to something else, gideros says :
main.lua:9: attempt to perform arithmetic on local 'czas' (a nil value)
stack traceback:
main.lua:9: in function

Comments

Sign In or Register to comment.