Posted 06 April 2014 - 03:03 PM
How to do something like, running 2 programs at once and if any will error then save the error to file (ex.) "/.log" ?
function firstprogram()
func, error = loadfile("testone")
if not func then
h = fs.open("log", "a")
h.writeLine(error)
h.close()
else
pcall(func)
end
end
function secondprogram()
func, error = loadfile("testtwo")
if not func then
h = fs.open("log", "a")
h.writeLine(error)
h.close()
else
pcall(func)
end
end
parallel.waitForAll(firstprogram, secondprogram)
Untested, might not work. I am not so good with loadfile.