小编Arr*_*At1的帖子

Strange "attempt to perform arithmetic on a function value" error in lua

I'm writing a BASIC interpreter in plain Lua, have hit a wall when writing my SLEEP X function.

I'm no expert but nothing looks wrong here...

function s(time)
local time=tonumber(time)
if useSleep then sleep(time) elseif useWait then wait(time) else
--oh no
--we will try our best
local ct=os.time+time
repeat until(os.time>=ct)
end end
--test
s(5)
Run Code Online (Sandbox Code Playgroud)

lua

1
推荐指数
1
解决办法
39
查看次数

标签 统计

lua ×1