cpopham Posted June 27, 2005 Posted June 27, 2005 I am using a dynamic array in a loop in my application and the redim is working well, but I need to know how to reset the array. Do i just use soemthing like ReDim MyArray() or would I use another method to clear the array out to where it was when I first declared it?? Thanks, Chester Quote ____________________________________________ http://www.pophamcafe.com I am starting a developers section, more tutorials than anything.
Machaira Posted June 27, 2005 Posted June 27, 2005 Why not just use one of the classes derived from the Array class? Quote Here's what I'm up to.
cpopham Posted June 27, 2005 Author Posted June 27, 2005 I have not worked with arrays much and am I just adding string values to the array until a certain condition is met and then I want to clear out the array. What derived classes are you talking about? Thanks, Chester Quote ____________________________________________ http://www.pophamcafe.com I am starting a developers section, more tutorials than anything.
iebidan Posted June 27, 2005 Posted June 27, 2005 you want to reset the array during the execution of the method? because when the method ends the array will be reseted, unless you're using it as part of the whole object instead of the method. Quote Fat kids are harder to kidnap
Diesel Posted June 27, 2005 Posted June 27, 2005 Use an ArrayList. System.Collections namespace iebidan: Fat kids move slower, so they are easier to catch, loading them into a vehicle is the hard part...but a hand truck would make it easier. Quote
jmcilhinney Posted June 28, 2005 Posted June 28, 2005 Use an ArrayList. System.Collections namespace iebidan: Fat kids move slower, so they are easier to catch, loading them into a vehicle is the hard part...but a hand truck would make it easier.I second that motion. Redimming an array is best avoided if at all possible. The ArrayList was created specifically to act as a dynamic array. It is more flexible than an Array object and can be converted by calling ToArray if a method requires an array argument. Quote
cpopham Posted June 28, 2005 Author Posted June 28, 2005 This is another post that I have http://www.xtremedotnettalk.com/showthread.php?t=93093 I am trying to dynamically add datacolumns to the relations and I thought that using a dynamic array would work, but it does not work either. But hey, I am learning more about arrays and arrays lists. Thanks, Chester Quote ____________________________________________ http://www.pophamcafe.com I am starting a developers section, more tutorials than anything.
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.