Solved

break points and immediate window

Posted on 2009-06-27
1
256 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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

772 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

12 Experts available now in Live!

Get 1:1 Help Now