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(12587)
Hello! Python by Anthony Briggs(9924)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9800)
The Mikado Method by Ola Ellnestam Daniel Brolund(9784)
Dependency Injection in .NET by Mark Seemann(9347)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8309)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7770)
Grails in Action by Glen Smith Peter Ledbrook(7704)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7565)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7137)
Microservices with Go by Alexander Shuiskov(6899)
Practical Design Patterns for Java Developers by Miroslav Wengner(6817)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6757)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6422)
Angular Projects - Third Edition by Aristeidis Bampakos(6175)
The Art of Crafting User Stories by The Art of Crafting User Stories(5697)
NetSuite for Consultants - Second Edition by Peter Ries(5628)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5440)
Kotlin in Action by Dmitry Jemerov(5072)
