I am reading the data in a string now i want loop through each char if chr equals to Chr(&h Anything) then the next two bytes will be the length of the string in network byte order how should i read all the strings to an array ?

This is what i have tried

Private Function SomeFunction(ChrToLookFor As String,data As String) As String()
On Error Resume Next
Dim i As Integer, result() As String, index As Integer
For i = 1 To Len(data)
If Mid(data, i, 1) = ChrToLookFor Then
ReDim Preserve result(index) As String
result(index) = Mid$(data, i + 3, Asc(Mid$(data, i + 1, 1)) * 256 + Asc(Mid$(data, i + 2, 1)))
i = i + 3 + Asc(Mid$(data, i + 1, 1)) * 256 + Asc(Mid$(data, i + 2, 1))
index = index + 1
End If
Next
SomeFunction = result
End Function