Appendix F : Error Handling


This appendix provides information on error handling.

Structured Error Handling

A Try block tries to execute some code and reacts to errors. The syntax is as follows:

  Try     try_statements... [Catch ex As exception_type_1     exception_statements_1...] [Catch ex As exception_type_2     exception_statements_2...] ... [Catch     final_exception_statements...] [Finally     finally_statements...] End Try 

When an error occurs, the program examines the Catch statements until it finds one that matches the current exception. The program executes the finally_statements after the try_statements succeed or after any Catch block is done executing.




Visual Basic 2005 with  .NET 3.0 Programmer's Reference
Visual Basic 2005 with .NET 3.0 Programmer's Reference
ISBN: 470137053
EAN: N/A
Year: 2007
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net