Posted 07 May 2013 - 12:32 PM
Quick question, i'm writing a gui and i'm using os.pullEventRaw to catch the termination event. However if I use read() it's possible to terminate while entering text. How do I stop this?
local oldpull=os.pullEvent
os.pullEvent=os.pullEventRaw
local function main()
-- do stuff here
end
local a,b=pcall(main)
if not a then
print(b)
os.pullEvent("key")
end
os.pullEvent=oldpull
will catch errors, ensuring it restores