Home > Software engineering >  VB6.0 by use BQ chat system
VB6.0 by use BQ chat system

Time:09-29

Private Sub Winsock1_DataArrival (ByVal bytesTotal As Long)
Dim mystr As String
Winsock1. GetData mystr
Dim IP As String
Dim qqnum As String
Dim arr () As String
Dim state As the String
Arr=Split (mystr, "* # # # # * * # # # # *", 1, vbTextCompare)
IP=arr (0)
Qqnum=arr (1)//is there a subscript crossing the line
State=arr (2)
CNN. The Execute "update tb_state set online status=" & amp; The state & amp; ", IP='" & amp; IP & amp; "' the where chat number=" & amp; Qqnum & amp; "'
"End Sub
Code real-time mistakes' 9 'subscript crossing the line
Why the great god of all stripes, please have a look, please answer wrong here did not declare the size of the array arr, isn't it?

CodePudding user response:

Single-step tracking, in arr=Split (mystr, "* # # # # * * # # # # *", 1, vbTextCompare) here to set a breakpoint,

You should look at mystr content, is does not contain "* # # # # * * # # # # *" this string,
So the Split (), only one element array arr arr (0), you can access other subscript, affirmation is crossing the line,
  • Related