Microsoft Visual Basic 2013 Step by Step
Author:Michael Halvorson [Michael Halvorson]
Language: eng
Format: epub
Tags: COMPUTERS / Programming Languages / Visual BASIC
ISBN: 9780735673403
Publisher: Microsoft Press
Published: 2013-11-18T16:00:00+00:00
Setting the trap: the Try…Catch code block
To create an exception handler in code, you place the Try statement in a routine right before the statement you’re worried about, and the Catch statement follows immediately with a list of the statements that you want to run if an exception actually occurs. A number of optional statements, such as Finally, Exit Try, and nested Try…Catch code blocks can also be included, as the examples in this chapter will demonstrate. The typical components of a Try…Catch exception handler are as follows:
Try Statements that might produce a run-time error Catch Statements to run if a run-time error occurs Finally Optional statements to run whether an error occurs or not End Try
The Try statement identifies the beginning of an error handler in which Try, Catch, and End Try are the essential keywords, and Finally and the statements that follow are optional. Note that programmers sometimes call the statements between the Try and Catch keywords protected code because any run-time errors resulting from these statements won’t cause the program to crash. (Instead, Visual Basic executes the error-handling statements in the Catch code block.)
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
NET | C & C++ Windows Programming |
SQL Server | VBA |
Visual Basic |
Deep Learning with Python by François Chollet(11823)
Hello! Python by Anthony Briggs(9351)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9322)
The Mikado Method by Ola Ellnestam Daniel Brolund(9288)
Dependency Injection in .NET by Mark Seemann(8835)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(7835)
Grails in Action by Glen Smith Peter Ledbrook(7286)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7263)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7096)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(5933)
Kotlin in Action by Dmitry Jemerov(4617)
Practical Vim (for Kathryn Amaral) by Drew Neil(3718)
Cracking the GRE Premium Edition with 6 Practice Tests, 2015 (Graduate School Test Preparation) by Princeton Review(3582)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3334)
Learn Windows PowerShell in a Month of Lunches by Don Jones(3223)
Learning Java by Patrick Niemeyer & Daniel Leuck(2861)
Learning React: Functional Web Development with React and Redux by Banks Alex & Porcello Eve(2821)
Mastering Java 9 by Dr. Edward Lavieri(2564)
Learning Concurrency in Python by Elliot Forbes(2540)