Hi,
I have an app that I build with 894 release and I’m using the json library to encode - decode data.
It works fine. Also I have stored the require in a local variable.
Now I need to make an update. When I tried to use the last stable release 971, I get an error. The code doesn’t read correct the decode function.
Is something change? I can’t find what is wrong. I also use director class in this project.
thanks a lot
[code] local json = require (“json”)
params.jsonFileW = function( filename, base )
if not base then base = system.ResourceDirectory; end
local path = system.pathForFile( filename, base )
–local contents
local file = io.open( path, “r” )
if file then
local contents = file:read( “*a” )
print( "Contents of " … path … “\n” … contents )
io.close( file )
end
return contents
end
params.xmlW = json.decode( params.jsonFileW( “workbook.json” ) )
print(params.xmlW ) – get nil instead a table
[import]uid: 13028 topic_id: 33315 reply_id: 333315[/import]