1. Home
  2. Computing & Technology
  3. Visual Basic

Chapter 9 - Structured Error Handling

By , About.com Guide

10 of 10

Assignment For Next Time

The book does mention this exact question on page 241 where a similar problem is solved by repeating exactly the same code in a second, nested Try ... Catch block . Usually, repeating exact sequences of code is a sign that something could be done better and this is no exception. Suppose you wanted to retry the disk five or ten times. Would you nest the Try ... Catch block five or ten levels deep? No way!

The book points out that you actually can do better by creating a function and promises to show how in the next chapter. But the book lies!!! There is no Try ... Catch example in the next chapter!

Just to get your creative juices flowing and help you pay attention in the next chapter, your assignment for next time is to recode the Disk Drive Error Handler program to allow ten retries before giving up (and simply clicking the Button ten times is not an allowed solution). As before ... my solution will be in the next lesson.

Enjoy!!!

Explore Visual Basic
By Category
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Learn VB.NET
  5. Trapping Errors Using Structured Error Handling

©2009 About.com, a part of The New York Times Company.

All rights reserved.