Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
43 views12 pages

Getting Started With Exception Handling & Debugging & Help

From these documents you will able to learn step by step, and you will be able to create projects as well as you can be good programmer or a good teacher or trainer on your filed

Uploaded by

eshamu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views12 pages

Getting Started With Exception Handling & Debugging & Help

From these documents you will able to learn step by step, and you will be able to create projects as well as you can be good programmer or a good teacher or trainer on your filed

Uploaded by

eshamu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Getting Started With Exception Handling & Debugging & Help

Exception
An exception is termed as an abnormal condition encountered by an application during execution.

Exception handling Is the process of providing an alternate path to be executed when the application is unable to execute in the desired way.

Structured exception
Divides an application into blocks of code that have the probability of raising an error. Uses the TryCatchFinally statement. Errors are filtered in the Catch block

Try
..statement that can cause exception.. Catch ex <Exception Class Name> ..code which will execute if respective exception occur..

Finally
..code which will execute regardless exception occurrence .. End Try

Unstructured exception
Is done by placing an On Error statement in a block of code. Uses the On Error GoTo statement to pass the control to a specific error handler when an error occurs. Uses the On Error Resume Next statement to pass control to the next executable statement when an error occurs. Uses the On Error GoTo 0 to disable an error handler On Error GoTo Lerr ..statement that can cause exception.. Exit Sub Lerr: ..code which will execute if respective exception occur.. [Resume Next]

User-defined exceptions
Can be created by deriving a class from the ApplicationException class.

Class UserExp Inherits ApplicationException Public Function GetErrorMessage() as String Return Invalid opertaion ..

End Function
End Class

Debugging
Tracing and rectifying an error is termed as debugging. In order to assist you in debugging logical and run-time errors, Visual Basic .NET provides extensive debugging tools. You can access these tools by using: Debug toolbar Debug menu

Debugging Cont..
In an application, by using the debugging tools, you can: Start execution Break execution Stop execution

A
Step Into Step Over Step Out

A, B, C

Debugging Windows
The following windows are used for debugging an application: Watch window Call Stack window The Output window

Help Providing
We can create following type helps for an application Context-sensitive help for an application Pop-up help Tool tips for a control

Help Providing cont..


Context-sensitive help for an application HTML help displays the help content from an HTML file. When the user presses the F1 key at run time, the HTML page containing the help content is displayed. By using HTML Help files, you can display online context-sensitive help to a user. HTML Help Workshop is a tool for creating HTML Help files, which store the help content in HTML format.

Help Providing cont..


Pop-up help Provides help through the Help button, also called the Whats This button, present in an application to the right of the title bar. Is most effective in modal dialog boxes.

Help Providing cont..


Tool tips for a control Is a brief help message for individual controls on a form. Can be displayed by adding a ToolTip control to the form and enter the text in the ToolTipText property of the control for which the tool tip is to be displayed. The SetToolTip() method of the ToolTip control is used to set the tool tip text for a control.

You might also like