• Welcome to Valhalla Legends Archive.
 

Whois BNET Command

Started by WarCow, March 19, 2003, 02:06 PM

Previous topic - Next topic

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?

Grok

#1
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?

WarCow

#2
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?)

Banana fanna fo fanna

#3
Write a FSM and Split() the received data.

WarCow

#4
And how do i do that?
-- Please help, im a big newb at vb6 right now

MrRaza

try
myarray() = split(string1,", ")

Camel

#6
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

if youprefer to organize it a bit more (this may be slightly more easy to understand, too):
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

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()]"