|
#1
|
|||
|
|||
|
error, pcall, Lua and AMS5
I've been exploring Lua a little and noticed it's error handling throw/catch mechanism using error()/pcall() I've successfully used this in an AMS 5 project
i.e. instead of: -------------------------------------------------------------------------- function foo() -- attempt to perform arithmetic on a string causes exception a = 'a'+1; -- this bit is not reached! return "All done!"; end local status, err = pcall(foo); Dialog.Message("Result of foo function", err, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); -- execution continues! -------------------------------------------------------------------------- I was wondering if it's possible to extend/override the default behaviour of pcall somehow so it calls my own error handler function (which I could define elsewhere?) Any ideas/example code much appreciated! Last edited by humdingerx; 11-16-2004 at 08:56 PM. |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
All times are GMT -6. The time now is 02:59 AM.








Linear Mode
