Jump to content

Vladimir

Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by Vladimir

  1. On 11/21/2015 at 8:44 PM, Lunarovich said:

    Thank you Rick. This is a solution I came up with. It's similar to yours. It puts a JSON string into a Lua table:

     

     

    
    
    --Load JSON (http://regex.info/blog/lua/json) library
    JSON = (loadfile "lua/JSON.lua")() -- put the lib in "lua" folder
    path = "pathToJSON"
    stream = FileSystem:OpenFile(path)
    jsonString = ""
    
    if (stream) then
    while (not stream:EOF()) do
     jsonString = jsonString .. stream:ReadString()
    end
    data = JSON:decode(Swinglets.jsonString)
    else
    System:Print("Stream not found")
    end
    
    
     

     

    Can you tell me why i get the following error:

    "attempt to index a nil value (global 'FileSystems')"

    and also in the path variable i have to initialize the path of the json that i want to parse right ? 

    Thank you ! 

×
×
  • Create New...