Jay1b Posted September 9, 2003 Posted September 9, 2003 I am using the following code to store an array in. Public Structure StructField Public FieldName As String Public FieldStartPos As Integer Public FieldLength As Integer End Structure Public Fields(1) As StructField I would like to delete a particular row in the array where the FieldName = Pants. Is it possible to delete a row out of an array? If so how? Thanks. Quote
*Experts* mutant Posted September 9, 2003 *Experts* Posted September 9, 2003 If you use an array list then you can simply use the Remove or RemoveAt method of it. A normal array doesnt have a method like that. Quote
Jay1b Posted September 9, 2003 Author Posted September 9, 2003 Could i combine the two in any way? To assign 'Fields' as a ArrayList to store the struct field in it? Personally i would much prefer to use a standard array system, but i have been told it must use the structure in there. Public Fields(1) As StructField Quote
Jay1b Posted September 9, 2003 Author Posted September 9, 2003 Would this work? Public Fields(1) As ArrayList = StructField Quote
*Experts* mutant Posted September 9, 2003 *Experts* Posted September 9, 2003 To insert things to an array list you can use Insert or InsertRange which can accept an array. Then to move it back to an array you use ToArray method of the ArrayList. Quote
Jay1b Posted September 9, 2003 Author Posted September 9, 2003 So are you saying that i create the array as i am now, then copy the array to an arraylist, delete the record from the arraylist and then copy the arraylist back to the standard array? Quote
*Experts* mutant Posted September 10, 2003 *Experts* Posted September 10, 2003 It looks like you want to do that so I just suggested how to do it. :) 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.