Solved

break points and immediate window

Posted on 2009-06-27
1
259 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 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 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