> prints the value of the _Age in the debug window
Vadivel:
I am using C# Express edition and I cannot get a "debug" window as such.
While running in debug mode, the windows I can get under Debug -> Windows
are: Output, Locals, Watch, Immediate, and Call Stack. None of these windows
will display _Age. Could this be a limitation of the Express edition?
Johann (newbie)
"Vadivel Kumar" <va*****@gmail.com> wrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
Yes, certainly there are ways. For example you have the code similar to
this.
public class Person
{
private Int32 _Age;
public Int32 Age
{
set {
_Age = value;
System.Diagnostics.Debug.Write(_Age.ToString());
}
get {
return _Age;
}
}
}
Check out the line System.Diagnostics.Debug.Write(_Age.ToString());
which prints the value of the _Age in the debug window.
Let us know if you have any trouble in doing this.
-
Vadivel Kumar
http://www.vadivelk.net
Johann Schuler wrote: Let's say I have a Person class with a private int age member variable. I
have a get and set accessor for the Age property. When I am running the
code
in debug mode, I would like to have a debug window show me the value of
age
(rather than the value of the Age property). Is there a way to do this?
Thanks!