Lost Password?

Go Back   CodeCall Programming Forum > Software Development > C# Programming

C# Programming C# (pronounced C-sharp) is a new object oriented language from Microsoft and is derived from C and C++. It also borrows a lot of concepts from Java too including garbage collection.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-24-2006, 10:17 AM
Void's Avatar   
Void Void is offline
Programming Expert
 
Join Date: Jun 2006
Posts: 410
Rep Power: 11
Void is on a distinguished road
Default Variable to Debug Window

Is there a way to output the valiue of a variable to the debug window?

Say variable _Mon
__________________
Void
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 06-26-2006, 06:06 AM
brackett brackett is offline
Programmer
 
Join Date: May 2006
Posts: 193
Rep Power: 10
brackett is on a distinguished road
Default

In VS, you can just do ?_Mon in the immediate window, or add a watch.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-26-2006, 02:00 PM
RobSoftware RobSoftware is offline
Programmer
 
Join Date: Nov 2005
Posts: 143
Rep Power: 11
RobSoftware is on a distinguished road
Default

I just created a program real quick that does what you ask:

Code:
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);
        }
    }
}

Quote:
Originally Posted by brackett
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-04-2006, 08:26 AM
brackett brackett is offline
Programmer
 
Join Date: May 2006
Posts: 193
Rep Power: 10
brackett is on a distinguished road
Default

Quote:
Originally Posted by RobSoftware
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 (c) add to the QuickWatch window by just typing the name in.

Of course, a Debug.WriteLine like you have will work as well.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Debug Mode dirkfirst Managed C++ 4 10-09-2007 08:11 PM
New window with custom content - JS domestic JavaScript and CSS 10 06-04-2007 02:08 AM
! Need urgent help ! Drawing program using cygwin siren C and C++ 0 05-26-2007 10:51 PM
Java:Tutorial - Making A Window John Java Tutorials 0 01-11-2007 02:02 PM
Java:Tutorial - The Variable John Java Tutorials 0 12-09-2006 09:59 AM


All times are GMT -5. The time now is 11:31 PM.

Contest Stats

Xav ........ 162.68
Sacback ........ 120.05
alearb8 ........ 120.05
tfusion ........ 120
amr2107 ........ 120
d3s!gn ........ 120
Qoolman21 ........ 120
Pillager ........ 108
satrian ........ 100
neerlin ........ 100

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 68%

Ads