G
Guest
hello,
i'm having a problem with the following piece of code. i use it to read a
string in an array, then search that string for ";;" symbols, then i read
what comes after that to a variable, witch goes to a text box. but every time
i run the subroutine, i get an "Object reference not set to an instance of an
object." error at the time it reaches "start = line.IndexOf(";;")"
also, wenn i set a breakpoint to debug it, de breakpoint red point's get a
question mark in it(meaning the code isn't avalible?). what's that all about ?
Code:
Dim line, start2 As String
Dim start As Integer
Dim counter As Integer = 0
If comments.Count = 0 Then
Exit Function
End If
While counter < countedcomments
counter += 1
line = comments(counter)
If line.StartsWith(fotos(positionarray)) Then
Exit While
End If
End While
start = line.IndexOf(";;")
If Not start = -1 Then
txtbijschrift.Text = ""
Exit Function
End If
start2 = Mid(line, start)
txtbijschrift.Text = start2
thanks for the help
jeroen
i'm having a problem with the following piece of code. i use it to read a
string in an array, then search that string for ";;" symbols, then i read
what comes after that to a variable, witch goes to a text box. but every time
i run the subroutine, i get an "Object reference not set to an instance of an
object." error at the time it reaches "start = line.IndexOf(";;")"
also, wenn i set a breakpoint to debug it, de breakpoint red point's get a
question mark in it(meaning the code isn't avalible?). what's that all about ?
Code:
Dim line, start2 As String
Dim start As Integer
Dim counter As Integer = 0
If comments.Count = 0 Then
Exit Function
End If
While counter < countedcomments
counter += 1
line = comments(counter)
If line.StartsWith(fotos(positionarray)) Then
Exit While
End If
End While
start = line.IndexOf(";;")
If Not start = -1 Then
txtbijschrift.Text = ""
Exit Function
End If
start2 = Mid(line, start)
txtbijschrift.Text = start2
thanks for the help
jeroen