C
Chris Mahoney
Hi
I am having difficulty with the IndexOf function. Here's what I'm doing:
With TextBox1
.Text &= "Hello Everyone" & vbCrLf
.Text &= "More Stuff" & vbCrLf
.Text &= "Total: " & myTotal
Dim TotalIndex As Integer
TotalIndex = .Text.IndexOf("Total")
End With
The problem I'm having is that the TotalIndex value ends up wrong. If I
place a breakpoint on the last line and step through, then the TotalIndex
variable gets set correctly, but if I remove the breakpoint and run straight
through then the TotalIndex value is wrong.
I've never seen anything like this, where stepping through the code returns
different values from running straight through. It looks like this Should
Not Happen, but it does anyway.
Any ideas?
Thanks
Chris
I am having difficulty with the IndexOf function. Here's what I'm doing:
With TextBox1
.Text &= "Hello Everyone" & vbCrLf
.Text &= "More Stuff" & vbCrLf
.Text &= "Total: " & myTotal
Dim TotalIndex As Integer
TotalIndex = .Text.IndexOf("Total")
End With
The problem I'm having is that the TotalIndex value ends up wrong. If I
place a breakpoint on the last line and step through, then the TotalIndex
variable gets set correctly, but if I remove the breakpoint and run straight
through then the TotalIndex value is wrong.
I've never seen anything like this, where stepping through the code returns
different values from running straight through. It looks like this Should
Not Happen, but it does anyway.
Any ideas?
Thanks
Chris