L8_ErrorHandling

L8_ErrorHandling - Error Handling and Debugging BIT 3444 G....

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
rror Handling and Debugging Error Handling and Debugging BIT 3444 G. Alan Wang 10.07.2008 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
rror Handling Error Handling bust application one that will A robust application is one that will continue its operation under adverse onditions conditions • For example, users may supply wrong puts inputs – Your application should not crash at the very ast least – Users deserve a good indication of what went rong and a chance to correct their mistakes 2 wrong and a chance to correct their mistakes
Background image of page 2
ypes of Errors Types of Errors •D e s i gn-time errors • Runtime errors ogic errors • Logic errors 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
esign- ime Errors Design Time Errors • Occur when you write a piece of code that does yp not conform to the rules of the VB language • The IDE will tell you what went wrong • Examples: – Mistyping keywords – Undeclared variables – Classes not imported Incorrect parameter lists in a function or subroutine co ec pa a e e s s a u c o o sub ou e call – Referencing members in a class that do not exist 4
Background image of page 4
xample of Design- ime Errors Example of Design Time Errors 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
xample of Design- ime Errors Example of Design Time Errors 6
Background image of page 6
xample of Design- ime Errors Example of Design Time Errors 7
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
untime Errors Runtime Errors • Occur when your program attempts something illegal (e.g., accessing data that do not exist) • The IDE does not give you any help in finding runtime errors • They cause your program to crash unless they are handled properly by code • Examples: – Dividing a number by zero – Users entering character data where a number is expected (and vice versa) ttempting to open a file that does not exist – Attempting to open a file that does not exist – Trying to connect to a database server with an incorrect username or password ou may use ata validation nd/or xception 8 You may use data validation and/or exception handling to take care of possible runtime errors
Background image of page 8
xample of Runtime Errors Example of Runtime Errors 9
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
he syntax for displaying a dialog box with an OK The syntax for displaying a dialog box with an OK button MessageBox.Show( text[ , caption] ) A statement that displays a dialog box MessageBox.Show( _ "Please enter a valid number for the Subtotal field.", _ "Entry Error") Entry Error ) The dialog box for the statement above Murach’s Visual Basic 2005, C7 © 2006, Mike Murach & Associates, Inc. Slide 10
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/12/2008 for the course BIT 3444 taught by Professor Gwang during the Fall '08 term at Virginia Tech.

Page1 / 27

L8_ErrorHandling - Error Handling and Debugging BIT 3444 G....

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online