O'Reilly logo

Microsoft® Visual Basic® 2010 Developer’s Handbook by Klaus Löffelmann and Sarika Calla Purohit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Error Handling in Code

To be honest, error handling in the old Visual Basic versions, which still function in .NET today, has always been anathema to me. If an error occurred after a very long routine in the finished program, it was difficult and required a lot of effort to locate the exact position of the error. The system variable Erl made it possible to show the line in which the error occurred in the error handler, but to achieve this, you had to number the code lines manually—a procedure that seemed rather antediluvian, even back then.

Today, discovering the exact location of an error is much, much easier, even though Visual Basic still allows the original error-handling syntax. Here’s a look at the before and after versions. The following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required