Solved

break points and immediate window

Posted on 2009-06-27
1
262 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 63

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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 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