Unstructured Exception Handling

This section will explain the older technique of dealing with exceptions, used in previous versions of Visual Basic. We strongly recommend that you use the structured exception handling (Try statements) as you just learned. This section is included for those who need to understand or migrate projects from previous versions of Visual Basic.

In Visual Basic there is a unique global object named Err. You can think of this as being a public variable of a special structure type. This object represents the last exception that has occurred anywhere in the program. It has a number of properties (fields), among which the most important are the Number and Description of the exception. We will explain what these are soon. ...

Get Visual Basic® .NET by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.