whitecatboard / Lua-RTOS-ESP32

Lua RTOS for ESP32
Other
1.18k stars 222 forks source link

load() gives nil #427

Closed progerstar closed 8 months ago

progerstar commented 8 months ago

load("print(2)") gives nil. why? and what are the additional parameters: chunkname (default value = "?") and mode = luaL_optstring(L, 3, "bt") ?

    local cmd = "your command here"
    print("now executing "..cmd)
    local function dostring (x) return assert(load(x), "")() end
    print(dostring(cmd))

Originally posted by @the0ne in https://github.com/whitecatboard/Lua-RTOS-ESP32/issues/405#issuecomment-1098922556

the0ne commented 8 months ago

I think that's a pretty Lua specific question, maybe best to ask in a forum regarding Lua itself.

progerstar commented 8 months ago

Generic lua works. Tests from ./components/fs_images/tests/tests - don't. Does your example work in your build?

progerstar commented 8 months ago

my mistake

the0ne commented 8 months ago

Ok. What was the cause of the issue?