1 Replies - 762 Views - Last Post: 25 January 2013 - 04:48 AM Rate Topic: -----

#1 GodSosukeAizen  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 24-January 13

Adding to a combo box from a split array

Posted 25 January 2013 - 03:49 AM

I have split up text from a file and placed it into an array. I then want to put those values from the array into a combo box as different values. Each time I try I either get no error initially but it crashes or doesn't do what it should or nothing when the program is run. or I get an error about a one dimensional array cannot be converted to string.

For example:
This doesn't add anything to the combo box and also doesn't bring up an error beforehand or when the program is running
 Do While SeatReader.Peek() <> -1
                    SeatRead = SeatReader.ReadLine()
                    SeatNumber = SeatRead.Split(",")
                    For i = 0 To 19
                        If Mid(SeatNumber(i), 1, 1) = "A" Then
                            Cbo_SelectSeat.Items.Add(Mid(SeatNumber(i), 2, 2))



Is This A Good Question/Topic? 0
  • +

Replies To: Adding to a combo box from a split array

#2 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3465
  • View blog
  • Posts: 11,755
  • Joined: 12-December 12

Re: Adding to a combo box from a split array

Posted 25 January 2013 - 04:48 AM

What are your variables declared as?
Do your comma-separated values always have at least 20 characters?

It is preferable to use:

For i As Integer = 0 To 19

This post has been edited by andrewsw: 25 January 2013 - 04:49 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1