return is nil after passing through wait function

Posted by Madcowchow on Fri 13 Mar 2015 06:56 AM — 2 posts, 12,893 views.

Kenya #0
Hello,

i have two functions like this :

function xxx()
y = yyy(1)
print (y)
end

function yyy(num)
require "wait"
wait.make (function()
wait.time(10)
mynum = num +1
return mynum
end)
end

im expecting output of print(y) ---> 2 but getting a nil value. it also outputs nil before the wait.time is completed.

Thanks in advance.
Kenya #1
nvm. found my answer here:

http://mushclient.com/forum/?id=12792