Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Json Problem — Gideros Forum

Json Problem

mertocanmertocan Member
edited May 2012 in General questions
I am using Json and i am encoding the high score in the save method but it doesnt save in to the txt file. What is the problem ? :S
-------------------------------------------



local scoreIndex = HighScore:checkEntry(10)
if scoreIndex <= HighScore:count() then
HighScore:storeEntry(scoreIndex, 40, "NameOfPlayer")
end
HighScore:save("score.txt")



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

function cScoreList:save(fileName)
--****************************************************************
local hsFile = io.open( fileName, "w" )
if hsFile then

local hsContent = json.encode(self.list)
hsFile:write( hsContent )
io.close( hsFile )
end
end

Comments

Sign In or Register to comment.