Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Exceptions/Lingo/exceptions-1.lingo
Normal file
19
Task/Exceptions/Lingo/exceptions-1.lingo
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
-- parent script "ErrorHandler"
|
||||
|
||||
on alertHook (me, errorType, errorMessage, alertType)
|
||||
if alertType=#alert then return 0 -- ignore programmatic alerts
|
||||
|
||||
-- log error in file "error.log"
|
||||
fn = _movie.path&"error.log"
|
||||
fp = xtra("fileIO").new()
|
||||
fp.openFile(fn, 2)
|
||||
if fp.status() = -37 then
|
||||
fp.createFile(fn)
|
||||
fp.openFile(fn, 2)
|
||||
end if
|
||||
fp.setPosition(fp.getLength())
|
||||
fp.writeString(_system.date() && _system.time() && errorType & ": " & errorMessage & RETURN)
|
||||
fp.closeFile()
|
||||
|
||||
return 1 -- continues movie playback, no error dialog
|
||||
end
|
||||
4
Task/Exceptions/Lingo/exceptions-2.lingo
Normal file
4
Task/Exceptions/Lingo/exceptions-2.lingo
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
-- in a movie script
|
||||
on prepareMovie
|
||||
_player.alertHook = script("ErrorHandler")
|
||||
end
|
||||
6
Task/Exceptions/Lingo/exceptions-3.lingo
Normal file
6
Task/Exceptions/Lingo/exceptions-3.lingo
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
-- in a movie script
|
||||
-- usage: throw("Custom error 23")
|
||||
on throw (msg)
|
||||
_player.alertHook.alertHook("Script runtime error", msg, #script)
|
||||
abort() -- exits call stack
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue