Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

please help MyArray problem

Status
Not open for further replies.

moviemadness

Programmer
Feb 21, 2003
2
GB
hi i get an error about
Microsoft VBScript runtime error: Subscript out of range: '[number: 0]'

see this is strange right cos this is my code:
this bit works..............
If Curuser.bOperator And CurUser.sName = CStr(owner) Then
If Mid(sCurData, 1, 5 + Len(botname)) = "$To: " & botname Then
MyArray = GetCmdArray(sCurData, ">", ";")
Select Case MyArray(0)


Case "DEMOTE"
If UBound(MyArray, 1) = 1 Then
If demote(MyArray(1)) Then
Curuser.PrivateMessage CStr(botname), MyArray(1) & " is deleted"
Else
Curuser.PrivateMessage CStr(botname), MyArray(1) & " is not a power OP"
End If
Else
Curuser.PrivateMessage CStr(botname), "error may be wrote wrong try - demote;nick"
End If
End Select

End If
End If

but this next one dont...............
If Curuser.bOperator Then
MyArray = GetCmdArray(sCurData, ">", ";")

If Mid(sCurData, 1, 1) = "$" Then
privat = 1
End If
Select Case MyArray(0)
Case "+UINFO"
If UBound(MyArray, 1) = 1 Then
Curuser.PrivateMessage CStr(botname), vbCrLf & GetUserInfo(MyArray(1), 1)
Else
Curuser.PrivateMessage CStr(botname), "ERROR::, UINFO;Nick please type again"
End If
End Select
End If
End Sub

all inside sub dataArrival and yes i did Dim Myarray
and here is the MyArray processing...................
Function GetCmdArray(Data, Start, Delimeter)
Dim i, MyArray, temp
Dim sCommand,x
Dim sDCI,sTmp
Dim iCHubs,iSlots
Dim sConn

If Start <> &quot;&quot; Then
For i = 1 To Len(Data)
If Mid(Data, i, 1) = Start Then
temp = Mid(Data, i + 1, Len(Data) - i)
Exit For
End If
Next

temp = Trim(temp)
Else
temp = Data
End If

MyArray = Split(temp, Delimeter, -1, 1)
MyArray(0) = UCase(MyArray(0))
GetCmdArray = MyArray

End Function


hope someone can help
u could also msn
gorillauk@lineone.net

TIA
 
ive sorted it

basically i forgot to tell it, that it has to wait for someone to submit the command uinfo;name/ip or blank

fanx anyway
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top