Valhalla Legends Forums Archive | Battle.net Bot Development | Viewing itemdata with a string index

AuthorMessageTime
WarCow
[code]
Dim abc As String
abc = Right(message, (Len(message) - 11))
'-11 because the command is 11 characters long including the space after it
'!lookupban '
If form1.bannedusers.ListCount < abc Then
GoTo error89112
End If
SendMsg = " ---- UserBan #" & abc & ": " & form1.bannedusers.ItemData(qaz89)
GoTo sendtext
[/code]
It says "Invalid Property Array Index"
March 22, 2003, 12:34 AM
tA-Kane
[quote][code]
Dim abc As String
abc = Right(message, (Len(message) - 11))
'-11 because the command is 11 characters long including the space after it
'!lookupban '
If form1.bannedusers.ListCount < abc Then
GoTo error89112
End If
SendMsg = " ---- UserBan #" & abc & ": " & form1.bannedusers.ItemData(qaz89)
GoTo sendtext
[/code]
It says "Invalid Property Array Index"[/quote]
If abc is the only parameter, use Mid(message,12) instead of Right()

My eyes are cought by abc being defined as a string, then being used in a compare against an in in .ListCount < abc, but since I use RB instead of VB, I don't know if this is illegal.

What is qaz89? I beleive that is your problem. If qaz89 isn't define as an integer or variant, then it is the most likely cause of a problem.

Why are you using GoTo statements? It's generally better to use a Method/Sub (or Function) instead of a GoTo.

/me hopes he's correct, from knowing RB instead of VB
March 22, 2003, 3:18 AM
St0rm.iD
eww
March 22, 2003, 2:03 PM

Search