Solved

break points and immediate window

Posted on 2009-06-27
1
257 Views
Last Modified: 2013-12-17
I am working through tutorial to understand break points and immediate window in C#.
its says if I put a break point at variable int sum = 0;
and at sum = sum1+1;
enter <?sum1> in immediate window( no brackets)
I can use F10 to walk through and see value change from 0 to 1
but as I hit F10 - it steps through but never goes to variable in command button and I never see value = 1.
Can you tell me how to use break points and immediate window to see how value changes from 0 to 1
thank you
public partial class Form1 : Form

    {

        int sum1 = 0;
 

        public Form1()

        {

            InitializeComponent();

        }
 

        private void Form1_Load(object sender, EventArgs e)

        {

           
 

        }
 

        private void button1_Click(object sender, EventArgs e)

        {

            sum1= sum1 + 1;
 

        }

    }

Open in new window

0
Comment
Question by:davetough
1 Comment
 
LVL 62

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 24727586
Hi davetough;

The immediate window works something like the DOS command window. You enter a command and hit enter and it will execute the command.

So placing the break point on the statements int sum1 = 0; and sum1= sum1 + 1;, when the program stops on the statement then go to the immediate window and type the command, ?sum1 followed by the Enter key, and the immediate window will print the current value of sum1. Press F10 then go back to the immediate window and type ?sum1 followed by the Enter key again and it will print the current value of sum1. In the immediate window you can press the Up Arrow key to automatically type the last command press it again and get the command before that and so on. Then you must press the Enter key again to execute that command, it will not automatically reprint the last command.

If you want to watch the value of sum1 automatically change as you press F10 when the values changes in the program then use the Watch window.

Fernando

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now