Results different in Output window than Immediate Window

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

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
 
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
 
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" <[email protected]>
| Sender: "Dave" <[email protected]>
| References: <[email protected]>
<O77c#[email protected]>
| Subject: Re: Results different in Output window than Immediate Window
| Date: Tue, 7 Oct 2003 07:32:55 -0700
| Lines: 24
| Message-ID: <[email protected]>
| 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.
| >.
| >
|
 
Back
Top