469,581 Members | 1,984 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Results different in Output window than Immediate Window

I'm getting different results when I display a value in
the Output window as opposed to the Immediate window.
Why?

Code to recreate problem:

'Purpose: Get different results from Output
window than Immediate
' window.

Dim sInput As String = Chr(48) & Chr(48) & Chr
(48) & Chr(0) & Chr(0) & Chr(48)
Dim sExpression As String
Dim m As Match
Dim re As Regex

'Pull everything but the garbage on the end.
sExpression = "(?<fieldvalue>.+\w+)(?
<garbage>\W*)"
re = New Regex(sExpression)
m = re.Match(sInput)
If m.Success Then

'Debug.writeline returns "6".
Debug.WriteLine(Now.ToString & " length is "
& m.Result("${fieldvalue}").Length)

'Set a breakpoint on the Beep.
'Run "? m.Result("${fieldvalue}").Length) in
the
'Immediate window.
'I get "3". Why different than "6" above?
Beep()
Else
MessageBox.Show("Something went way wrong.")
End If

End Sub

Jul 21 '05 #1
2 2656
I'm getting different results when I display a value in
the Output window as opposed to the Immediate window.
Why?


The debugger doesn't handle strings containing null characters
correctly.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
Jul 21 '05 #2
Hi Dave,

This is a known issue. The problem lies in the debug API and will not be
fixed.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| Content-Class: urn:content-classes:message
| From: "Dave" <dv****@5280Solutions.com>
| Sender: "Dave" <dv****@5280Solutions.com>
| References: <05****************************@phx.gbl>
<O7**************@TK2MSFTNGP12.phx.gbl>
| Subject: Re: Results different in Output window than Immediate Window
| Date: Tue, 7 Oct 2003 07:32:55 -0700
| Lines: 24
| Message-ID: <10****************************@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: quoted-printable
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcOM3+WYnwizbvMpQW2c8VG8bGtJIA==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.dotnet.general
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:111033
| NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| Thanks!
| Anyone know when a fix will be available?
| >-----Original Message-----
| >
| >>I'm getting different results when I display a value in
| >>the Output window as opposed to the Immediate window.
| >>Why?
| >
| >The debugger doesn't handle strings containing null
| characters
| >correctly.
| >
| >
| >
| >Mattias
| >
| >--
| >Mattias Sjögren [MVP] mattias @ mvps.org
| >http://www.msjogren.net/dotnet/
| >Please reply only to the newsgroup.
| >.
| >
|

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by John A Grandy | last post: by
3 posts views Thread by Russell Stevens | last post: by
2 posts views Thread by dgk | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.