Valhalla Legends Forums Archive | Battle.net Bot Development | Whois BNET Command

AuthorMessageTime
WarCow
If there a way i could send all of the names recieved from the whois command into a listview?

User(s) In Clan w@r
name1, name2
name3, name4
name5, name6


Or


User(s) In Clan W@R
name1
name2
name3


How could i do it for both ways?
March 19, 2003, 8:06 PM
Grok
YourListView.ListItems.Add name1
YourListView.ListItems.Add name2
YourListView.ListItems.Add name3
YourListView.ListItems.Add name4
YourListView.ListItems.Add name5
YourListView.ListItems.Add name6
YourListView.ListItems.Add name7
...
...
get it?
March 19, 2003, 8:48 PM
WarCow
Yeah, but how would i get all the names, i know how to add them to the list, but how would i get the name in the reply to a string
dim aaa as string
aaa = name1(how would i get name1?)
March 19, 2003, 9:16 PM
St0rm.iD
Write a FSM and Split() the received data.
March 19, 2003, 9:22 PM
WarCow
And how do i do that?
-- Please help, im a big newb at vb6 right now
March 19, 2003, 9:42 PM
MrRaza
try
[code]myarray() = split(string1,", ")[/code]
March 19, 2003, 11:34 PM
Camel
[code]Dim Info As String

Info = "UserOne, UserTwo"
'or
Info = "UserOne"

Dim User As Variant
For Each User In Split(Info, ", ")
   'executes this code for each element in an array created from a ", " delimited string
   [ListView].ListItems.Add User
Next User[/code]

if youprefer to organize it a bit more (this may be slightly more easy to understand, too):
[code]Dim User As Variant, UserArray() As String
UserArray = Split(Info, ", ")
For Each User In UserArray
   'executes this code for each element in an array created from a ", " delimited string
   [ListView].ListItems.Add User
Next User[/code]

i personally prefer the first because it's more consise, but they do the exact same thing
note that User must be a Variant and not a String because For Each will only take "For Each [Variant] In [Object()]"
March 21, 2003, 2:35 PM

Search