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
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