Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Howdy,

 

This is my first post, and I'm still a novice at VB.Net. However, I am currently working on a project at school, and I am stuck. What I need to do is store multiple lines of text into an array, and then store that array into an array. I've tried everything I know, and consulted numerous books, to no avail. Any help would be appreciated.

 

Here it goes. The user enters info in to text fields, and hits the add button. Once the button is clicked, the information from the text fields are added in a single line to a list box. Once the user is finished adding lines of text to the listbox, the Save button is clicked. All of the text in the listbox must then be saved to an array, which is then saved to an array of array's. I hope this helps.

 

Thanks

 

George

Posted
Since your array changes size dynamically I would try using a System.Collections.ArrayList to store the data. And you could probably do an ArrayList of arrays, or an ArrayList of ArrayLists
  • *Experts*
Posted

you could also Redim the array as it is initially loaded from the listbox or textboxes.ie: ReDim array(Listbox1.Items.Count - 1) then:

 

Dim i as Integer

For i = 0 to Listbox1.Items.Count - 1

array(i) = ListBox1.Items(i)

Next

 

That'll do it with standard arrays....but Optikal is really correct, array lists are easier to add and remove items dynamically.

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

  • 10 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...