469,626 Members | 1,016 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,626 developers. It's quick & easy.

Debug.Writeline() not doing new line?

I use the following to output to the console during debugging:

catch(Exception ex) {
Debug.WriteLine("Error: " + ex.Message);
}

Many of the times on the console, the above is appended on the same line.
Sometimes it goes on a new line. I don't have any thing in my code related
to trace listeners. Any suggestions as to why this is occuring?

Thanks,
Brett
Nov 17 '05 #1
3 6149

"Brett" <no@spam.com> wrote in message
news:eK*************@TK2MSFTNGP15.phx.gbl...
I use the following to output to the console during debugging:

catch(Exception ex) {
Debug.WriteLine("Error: " + ex.Message);
}

Many of the times on the console, the above is appended on the same line.
Sometimes it goes on a new line. I don't have any thing in my code
related to trace listeners. Any suggestions as to why this is occuring?

Thanks,
Brett


WriteLine means write the string to the console at the current cursor
location and advance to the next line when done.
It looks like what was written before didn't append a cr/lf, so it was done
using Console.Write.

Willy.

Nov 17 '05 #2

"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:e%****************@TK2MSFTNGP09.phx.gbl...

"Brett" <no@spam.com> wrote in message
news:eK*************@TK2MSFTNGP15.phx.gbl...
I use the following to output to the console during debugging:

catch(Exception ex) {
Debug.WriteLine("Error: " + ex.Message);
}

Many of the times on the console, the above is appended on the same line.
Sometimes it goes on a new line. I don't have any thing in my code
related to trace listeners. Any suggestions as to why this is occuring?

Thanks,
Brett


WriteLine means write the string to the console at the current cursor
location and advance to the next line when done.
It looks like what was written before didn't append a cr/lf, so it was
done using Console.Write.

Willy.


I use Debug.Writeline() and not Write anywhere. Could it be something else?

Thanks,
Brett
Nov 17 '05 #3

"Brett" <no@spam.com> wrote in message
news:%2******************@TK2MSFTNGP14.phx.gbl...

"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:e%****************@TK2MSFTNGP09.phx.gbl...

"Brett" <no@spam.com> wrote in message
news:eK*************@TK2MSFTNGP15.phx.gbl...
I use the following to output to the console during debugging:

catch(Exception ex) {
Debug.WriteLine("Error: " + ex.Message);
}

Many of the times on the console, the above is appended on the same
line. Sometimes it goes on a new line. I don't have any thing in my
code related to trace listeners. Any suggestions as to why this is
occuring?

Thanks,
Brett


WriteLine means write the string to the console at the current cursor
location and advance to the next line when done.
It looks like what was written before didn't append a cr/lf, so it was
done using Console.Write.

Willy.


I use Debug.Writeline() and not Write anywhere. Could it be something
else?

Thanks,
Brett


Not sure what exception is thrown but keep in mind that Debug.WriteLine
displays the string at the "current" cursor position, if that position is
not a the beginning of a new line it means that the last IO was a Write or
the Exception (and the Debug.WriteLine) interferes with a currently
executing Console output.

Willy.

Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by John A. Bailo | last post: by
4 posts views Thread by Wal Turner | last post: by
7 posts views Thread by Thomas Pecha | last post: by
5 posts views Thread by John A Grandy | last post: by
7 posts views Thread by Bernard Bourée | last post: by
reply views Thread by BA | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.