Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: WarCow on March 21, 2003, 06:34 PM

Title: Viewing itemdata with a string index
Post by: WarCow on March 21, 2003, 06:34 PM
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
It says "Invalid Property Array Index"
Title: Re: Viewing itemdata with a string index
Post by: tA-Kane on March 21, 2003, 09:18 PM
QuoteDim 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
It says "Invalid Property Array Index"
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
Title: Re:Viewing itemdata with a string index
Post by: Banana fanna fo fanna on March 22, 2003, 08:03 AM
eww