Stupid Question VB Split Function

I am sending data from one winsock to another, I can format this in a string as so...

StrString = Username,IP,Lport,RPort,FileName,Message

This is devided by comma delimited...and I have tried a bunch of characters to extract this..maybe I am just tired

What I need to do is this... break the string up
Take strString and put it into:

Dim User as string = The user in the string
Dim IP as string = The IP from the string
dim LPort as String = The Lport
dim RPorts as string = the RPort
Dim Filename as String = The File name
Dim Message as string = The message

I need this "broke out" of the string ...I am sure you get this, I forgot how to do it right and my ms help stuff doesnot remind me...

Thanks



flosoftAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JohnMcCannCommented:
Dim ArrayArgs() as string

Const USER_NAME = 1

ArrayArgs = split("Username,IP,Lport,RPort,FileName,Message",",")

Then use

ArrayArgs(USER_NAME)

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
flosoftAuthor Commented:
LOL...I figured it out just before I got your comment, I just did the number after...like this:
Private Sub Command1_Click()
'Text1.Text = "User1,192.168.254.101,2000,4000,c:\readme.txt,This is a text file"
Dim InputString
Dim Name As String
Dim IP As String
Dim LPort As String
Dim RPort As String
Dim FileName As String
Dim Message As String

InputString = Text1.Text
InputString = Split(InputString, ",", -1)
Name = InputString(0)
IP = InputString(1)
LPort = InputString(2)
RPort = InputString(3)
FileName = InputString(4)
Message = InputString(5)

MsgBox "Name" & Name & vbCrLf _
& "IP:" & IP & vbCrLf & "Local Port: " & LPort _
& vbCrLf & "Remote Port: " & RPort & vbCrLf & _
"File to be transfered: " & FileName & vbCrLf & _
"Message from sender: " & Message, vbInformation, "Split Test"
End Sub


Both do exactly the same thing, but your way is way better for true newbie as your pre-names the splits. I do thank you for your comment, and I am letting the points go...thanks.
0
JohnMcCannCommented:
No probs
0
JohnMcCannCommented:
To let the points go and close the question you must click accept answer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.