Posted 07 October 2014 - 06:21 PM
Please help! I got stuck with error catching!
Code:
Please fix my error catcher. :(/>
This code is for my OS!
Code:
prToRun = "wtOS/apps/lol"
function runPr(prToRun)
m.ccl(32768)
m.tc(1)
m.crp(1,1)
os.pullEvent = oldpull
function main()
shell.run(prToRun)
return
end
local ok, val = pcall(main)
print(ok)
print(val)
os.pullEvent("key")
--if ok then
--main()
--else
--shell.run("wtOS/bsod "..'"'..val..'" '..prToRun)
--end
os.pullEvent = os.pullEventRaw
m.ccl(dbg)
redrawScr()
return
end
LOL file contains:
losfmasd;fnsdlagsnfgklnadf;gdf;gkn
bsod file:
os.loadAPI("wtOS/apis/m")
Args = { ... }
m.ccl(2048)
m.tc(32768)
m.bc(1)
m.cpr("wtOS",2)
m.bc(2048)
m.tc(1)
m.tpr("A problem has been detected and wtOS has been terminated this program to prevent damage to your computer.",1,4)
write("\n\nThe problem seems to be caused by file: \n"..Args[2])
m.tc(16384)
m.cpr(Args[1],12)
m.tc(1)
m.cpr("Press Any Button to Continue",18)
os.pullEvent("key")
return
That all works fine, but when error found, it prints ok = true… true cant be!Please fix my error catcher. :(/>
This code is for my OS!
Edited on 07 October 2014 - 04:21 PM