Posted 01 January 2013 - 07:54 AM
Hey all! I have been beating my head against this particular problem for better part of two days. So before I go bloody my nose some more I figured I would post the problem I am experiencing in hopes that someone has a clue for me.
The issue is with os.queueEvent() and os.pullEventRaw(). I post an event using queueEvent(), and that event has a table as one of the event parameters. When I pull the event using pullEventRaw(), the parameter for the table is nil.
Here is some demonstration code:
I would expect the last print in the loop to print something like "table", but nothing is emitted.
The issue is with os.queueEvent() and os.pullEventRaw(). I post an event using queueEvent(), and that event has a table as one of the event parameters. When I pull the event using pullEventRaw(), the parameter for the table is nil.
Here is some demonstration code:
os.queueEvent("start")
while true do
local event = { os.pullEventRaw() }
if event[1] == "terminate" then
print("terminating...")
return
elseif event[1] == "start" then
print("starting")
os.queueEvent("end", 1, 2, 3, 4, 5, {1})
elseif event[1] == "end" then
print("ending")
for i,v in pairs(event) do
print(string.format("%s=%s", tostring(i), tostring(v)))
end
os.queueEvent("terminate")
end
end
I would expect the last print in the loop to print something like "table", but nothing is emitted.