Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array to msgbox showing on next line

Status
Not open for further replies.

aueddonline

Technical User
Jun 29, 2010
2
GB
I have this code that takes the the text from a multiline textbox line by line, I then have another textbox, when I try to concatenate these together in a message box the first massage box displays correctly but then subsequent ones show a line break so the dirs(1) dirs(2) etc show on a newline?

Dim arrlist As ArrayList
arrlist = New ArrayList
Dim dirs() As String
Dim line As String
Dim i As Integer
Dim major As String = txtmajor.Text
dirs = TextBox1.Text.Split(vbCrLf)
Dim length As Integer = dirs.Length - 1

For Each line In dirs
line = line.Replace(vbCr, "").Replace(vbLf, "")
arrlist.Add(line)
Next

For i = 0 To length

MsgBox(major & "\" & dirs(i))

Next
 
okay, i think I have it now, I was trying to use the wrong array there at the end, should have been arrlist(i) instead of dirs(i)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top