mopuck36 Posted November 15, 2003 Posted November 15, 2003 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 Quote
Optikal Posted November 15, 2003 Posted November 15, 2003 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 Quote
*Experts* DiverDan Posted November 15, 2003 *Experts* Posted November 15, 2003 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. Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
Kikketer Posted September 27, 2004 Posted September 27, 2004 How would I go about assigning a reference of a 1D array to an ArrayList? So I would really have an arraylist of arrays. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.