Presentation is loading. Please wait.

Presentation is loading. Please wait.

Debugging Visual Basic.NET Programs ► ► Use debugging tools ► ► Set breakpoints and correct mistakes. ► ► Use a Watch and Local window to examine variables.

Similar presentations


Presentation on theme: "Debugging Visual Basic.NET Programs ► ► Use debugging tools ► ► Set breakpoints and correct mistakes. ► ► Use a Watch and Local window to examine variables."— Presentation transcript:

1 Debugging Visual Basic.NET Programs ► ► Use debugging tools ► ► Set breakpoints and correct mistakes. ► ► Use a Watch and Local window to examine variables during program execution.

2 Logic error example If Age > 13 And Age < 20 Then TextBox2.Text = “ You ’ re a teenager ” Else TextBox2.Text = “ You ’ re not a teenager ” End If A teenager is a person who is between 13 and 19 years old

3 The structure fails to identify the person who is exactly 13

4 Debug Tool Bar ► ► Break mode gives you a close-up look at your program while the Visual Basic compiler is executing it. Break All Start Stop Step Into Step Out Step Over Run To Cursor Breakpoints Locals Watch1

5 Breakpoint ► You can set a breakpoint by clicking the gray margin to the left of the line of code shown. Breakpoint Gray margin

6 Debug Toolbar ► Step Into  You can step through your code line by line.  This includes stepping into any function or procedure that the code calls. ► Step Over  Works in a similar way to Step Into, but you pass straight over the procedures and function

7 Debug Toolbar ► Step Out  This allows you to jump to the end of the procedure or function that you are currently in  Move to the line of code after the line that called the procedure or function.  This is handy when you step into a long procedure and want to get out of it.

8 Debug Toolbar ► Run To Cursor  Enable you to place your cursor anywhere in the code following the current breakpoint.  The code between the current breakpoint where the cursor is positioned will be executed  The execution will stop on the line of code where the cursor is located.

9 Working With Breakpoint ► To view the Data Tip hover the mouse over the variable. ► You can change the contents of the variable by clicking the variable name then change the text box value.

10 Watch Window ► It is provides a method for you to watch variable and expressions easily while the code is executing. ► You can add and delete only when your program is in break mode. ► It is allow to change the value of a variable.  The text for the value turn to red. ► You need to set a breakpoint before the variable that you want to watch

11 Watch Window ► Step 2

12 Watch Window ► Step 3

13 Local Window ► It is similar to the Watch window. ► It shows all variables and objects for the current function or procedure.


Download ppt "Debugging Visual Basic.NET Programs ► ► Use debugging tools ► ► Set breakpoints and correct mistakes. ► ► Use a Watch and Local window to examine variables."

Similar presentations


Ads by Google