?
Solved

break points and immediate window

Posted on 2009-06-27
1
Medium Priority
?
266 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

777 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