Hey everybody. Maybe someone of you knows about Visual Basic? I'm working with VB 2010 and I've a little problem in one of my functions. I'm going to make an porting program for codes^^
Here is my function which finds the Xth Value in one ram dump.
Most of time it works but sometimes I didn't get any result (It looks like there is no value in the ram dump o.O). All of my other functions work perfectly so that I can find the position and the number of values in one ram dump. But as you may know I have to search for it in another ram dump, too .
Maybe someone have an idea?
Here is my function which finds the Xth Value in one ram dump.
- Code:
Function IndexOfXthContent(ByVal Target As String, ByVal Content As String, Optional ByVal n As Integer = 1) As Integer
Dim Offset = -1, Idx = 0
For i = 1 To n
Offset = Target.IndexOf(Content, Idx)
If Offset >= 0 Then Idx = Offset + Content.Length Else Exit For
Next
Return Offset
End Function
Most of time it works but sometimes I didn't get any result (It looks like there is no value in the ram dump o.O). All of my other functions work perfectly so that I can find the position and the number of values in one ram dump. But as you may know I have to search for it in another ram dump, too .
Maybe someone have an idea?