Hi guys.
I have a little problem and i hope someone can help me or tell me a thread with a solution. I cannot find something about my problem.
I’have two files. One File is a modula Class (portal):
local t = {}
function t:timer(event)
local params = {}
params.body = '...'
local count = event.count
network.request( server .. '/somerequest', "POST", networkListener , params)
if someValue ~= nil then -- someValue is changed in networkListener
timer.cancel(event.source)
end
end
function portal.getPartner()
if(nick ~= nil) then
if(sessionId == nil) then
timer.performWithDelay(2000,t, 15)
end
end
end
In the second file (main) i’m calling getPartner from portal-class like:
print("pre")
portal.getPartner()
print("post")
is there a way to wait for the end of the delayed Function.
Only to show you what i mean, i want to have that “pre” is printed and “post” is printed after the timer funktion has ended.
I hope you understand what i want to to and someone can tell me how to get this running
Thanks [import]uid: 189020 topic_id: 34325 reply_id: 334325[/import]