Is there a way to output the valiue of a variable to the debug window?
Say variable _Mon
Variable to Debug Window
Started by Void, Jun 24 2006 07:17 AM
3 replies to this topic
#1
Posted 24 June 2006 - 07:17 AM
Void
|
|
|
#2
Posted 26 June 2006 - 03:06 AM
In VS, you can just do ?_Mon in the immediate window, or add a watch.
#3
Posted 26 June 2006 - 11:00 AM
I just created a program real quick that does what you ask:
I'm not sure what you mean brackett - how do I add a watch in VS?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace debugTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
String _Mon = "TEST";
System.Diagnostics.Debug.WriteLine(_Mon);
}
}
}
"brackett" said:
In VS, you can just do ?_Mon in the immediate window, or add a watch.
I'm not sure what you mean brackett - how do I add a watch in VS?
#4
Posted 04 July 2006 - 05:26 AM
RobSoftware said:
I'm not sure what you mean brackett - how do I add a watch in VS?
I assumed that Void was interested in knowing the value while debugging. In that case, in the VS debugger you can (a) use the immediate window and type "?variableName" which will print the value, (b) hover over the declaration and a tooltip will show you the value, or © add to the QuickWatch window by just typing the name in.
Of course, a Debug.WriteLine like you have will work as well.


Sign In
Create Account


Back to top









