|
Post by equin0x on Feb 7, 2004 11:02:16 GMT -5
I have a variable Rdata, all the data recieved from the server is put into that string I want to now split up the data being sent, so I can take away all the unneeded crap and be left with just peoples text and names Could anyone show me how this is done ? thanks..
|
|
|
Post by Lazer on Feb 7, 2004 11:27:46 GMT -5
do u use select case's ?
u could use something like
Case "PRIVMSG" Dim Word As String Dim Name As String Name = (Left$(Rdata, InStr(Rdata, "!") - 1)) Name = Right$(Name, Len(Name) - 1) Word = Split(Rdata, ";0")(1) Word = Replace(Word, "", "") [glow=red,2,300]This is an example of how to display[/glow] richtextbox1 = Name & " " & Word & vbcrlf
this is just an exaple hope it helps ya#nosmileys
|
|
|
Post by equin0x on Feb 7, 2004 11:40:05 GMT -5
Name = (Left$(Rdata, InStr(Rdata, "!") - 1))
I mean, does anyone know a tutorial which explains what left$ right$ etc means and what the -1 , -2 mean and when to use each one ?
thanks but.
|
|
Tewl
xTeam
C# & VB Developer
Posts: 495
|
Post by Tewl on Feb 7, 2004 20:18:14 GMT -5
Left & right have two parameters. returns a string 1. string you are reading. 2. number of characters from the left/right
Mid has 2 parameters that are required and 1 that is optional, returns a string 1. String that you are reading 2. Position at which to start ( 1 being first character 5 being the 5th ect.. ) 3. Is how many characters u want to show after the starting position. If you do not specify this parameter it will return all characters after the starting position.
Instr has 2 parameters an returns an integer which represents the first occurance of a string in specified text. If the return is zero the string is not in the text 1. string(text) to read 2. string to look for
|
|
|
Post by equin0x on Feb 7, 2004 21:45:28 GMT -5
ok, thanks for your help I understand it now =]
|
|