Structured Exception Handling Visual Basic .NET still supports On Error Goto error handling, but you should replace the old VB6 style On Error Goto statements with structured exception handling. (It's also likely that On Error Goto will be removed in future versions of VB; Microsoft is giving us a chance to get used to exceptions.) Structured exceptions are one aspect of VB .NET that promote VB to a first-class language. Exceptions are subclassed from Objects and exception handling is more robust and precise than On Error Goto. Exception handling was invented as a means of replacing the error-prone error code return value and supports writing more robust applications. Exception handling in VB .NET supports Try...Catch exception blocks and Try...Finally resource protection blocks. This topic requires more than a few paragraphs, so considerable coverage is provided in Chapter 3, "Basic Programming in VB .NET." |
Team-Fly |
Top |