Splitting received data from winsock client into text boxes
Posted on 2004-04-04
Hello, I am trying to split received data from a winsock client into 4 text feilds. I have tried this method but I am getting the error "Runtime Error '9" "Subscript out of range". I cannot see why though, please help.
Here is my code.
Dim str As String
str = Text1.Text & Chr$(0) & Text2.Text & Chr$(0) & Text4.Text & Chr$(0)
Dim sArrParams() As String
sArrParams = Split(Data, Chr$(0))
Text1.Text = sArrParams(0)
Text2.Text = sArrParams(1)
Text3.Text = sArrParams(2)
Text4.Text = sArrParams(3)