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)

1 Answers

5
lhf On Best Solutions

You need to call os.time, with os.time().

os.time is the function.

os.time() is its result.