O'Reilly logo

.NET Common Language Runtime Unleashed by Kevin Burton

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

VB Exceptions

Exceptions are relatively new to VB; therefore, many VB programmers will take a little while to get used to the syntax and the idea behind exceptions. VB's On Error GoTo XXX resembles current exception handling.

Basic VB Exceptions

Listings 15.15 and 15.16 illustrate the basics of VB exception handling. This code sample follows the form of the VC++ sample shown earlier in that an ExceptionGenerator throws or causes various exceptions based on an integer selector that is passed as an argument. This sample illustrates a custom exception, a divide-by-zero exception, a stack overflow exception, and a FileNotFoundException. The full source for this sample can be found in the VBExceptions\BasicExceptions directory. Listing 15.15 shows ...

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