Closed yu66433 closed 1 year ago
Did it work before? Could you attach something which was working so I can fix this.
it doesn't output any log when i use json.encode
in my project ;
VSCode Launch Config
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Corona-Run",
"type": "lua-local",
"request": "launch",
"program": {
"command": "%CORONA_PATH%/Corona Simulator.exe"
},
"args": [
"-no-console",
"main.lua"
]
}
]
}
main.lua
json = require("json")
print("====== before encode")
local sRet = json.encode({a = 1})
print("====== encode result:", sRet)
print("====== after encode")
local iCount = 1
timer.performWithDelay(1000, function()
print(iCount)
iCount = iCount + 1
end, -1)
Did it work before? Could you attach something which was working so I can fix this.
Seeing that your print statements are working(see "before encode" and "encode result"), this seems like an issue on your side rather than the engine. I'd suggest taking this to the Discord channel(https://discord.gg/Abf5V9G) or the forums(https://forums.solar2d.com/).
I tested printing json.encode via the new Solar2D code extention and seems to work fine :)
i create a task to launch corona with no-console.but vs code doesn't show lua output?