Thursday, October 1, 2009

Video on Breakpoints

A video on the implementation of Breakpoints.

Saturday, August 29, 2009

Visual Studio 2008: Introduction to Breakpoints

I stumbled upon the breakpoints feature available in VS.net 2008 while working on my academic mini project. In this post I would like to introduce you to this feature, which would help you effectively debug your programs.


How many times would your programs run flawlessly the very first time you compile it? Hmmm… probably very few times. But as beginners we may tend to go wrong in the code. Just imagine as what would happen, if a programmer who could code a program spending a lot of time on it and is finally unable to get the required output to achieve a particular task? Gosh!! All his time and efforts would have gone a waste. So the very next task what we need to do after coding is to DEBUG the same, to sort out the errors, which finally would help us execute them and get the results. Thanks to the concept of DEBUGGING.


Breakpoints is a feature available in VS.net which makes debugging easier and faster. Breakpoint as the name suggests “breaks” the application code at certain “points” or conditions during the process of debugging. Visual studio supports 4 types of breakpoints.


I will now explain the concept of breakpoints by considering the following example.

(I assume that you have written and successfully run a “HelloWorld” program in Visual Studio. However I will certainly write about basics of using VS.net in my future posts.)

Step1: Open a VS.net 2008 and create a windows form as shown in screen1.

Step2: Double click on the ‘Submit’ button in your design view.

Step3: At the end of Step2 you would have automatically navigated to the code view.

Step4: Type the following program in the code view.


Step5: In order to insert the breakpoint, select the required line of code and ‘right click’ the mouse button, choose breakpoint and then go to ‘Insert Breakpoint’. (Finally a red ball appears at that line indicating that breakpoint has been inserted.)

Step6: Click on the ‘Start Debugging’ button. Enter the number on the windows form that pops up and click the ‘Submit’ button.

Step7: Then a Yellow Arrow appears within the red ball (breakpoint) indicating the current line being executed and by pressing the ‘Step Into’ button the Yellow Arrow moves into the next line of code or prints the message based on the given input and finally reaches the End If statement.

Step8: In order to delete the breakpoint, ‘right click’ on the red ball, and then click on ‘Delete Breakpoint’ button.

Welcome....

Hello!! 'm Ashwini Bhaskaran, a final year student doing my bachelors at N.M.I.T. in the stream of Information Science.