![]() |
Using OnError - Printable Version +- Mirage Engine (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: Using OnError (/showthread.php?tid=165) |
Using OnError - Bradyok - 04-07-2006 In my serverside HandleData i've tried to set up an error handling system. For every packet being recieved it sets CurrRunning to the packet name. Now what i want is for when it finds an error, to write it in the log. I'm not sure exactly how OnError works, just OnError Resume Next, but i'm sure someone can help me. - funkynut - 04-07-2006 If running the the code after the error doesnt matter, make a label at the end of the sub e.g 'ErrorHandler:' ' HandleError:' then put 'OnError GoTo ErrorHandler' or what ever you called the lebel Btw, make sure you put exit sub or exit function before the lebel, otherwise if the code allows, it will run the error handler no matter what - grimsk8ter11 - 04-07-2006 Code: Sub HandleData(Index As Long, Data As String) visual representation of what funky said. Or soemthing like this: Code: Sub HandleData(Index As Long, Data As String) that will continue through the code and post the error at the end, incase things still need to be ran further on. - Misunderstood - 04-07-2006 Quote:Sub Handledata - BigRed - 05-07-2006 Also keep in mind, On Error GoTo 0, is useful for stopping all error handling routines in the current procedure. - Bradyok - 05-07-2006 Thanks alot. |