Hi, I use an array of ints to track a list of numbers that I want to store. I add a series of numbers to this array and then when I have processed what I need to process I set all the elements in the array to NULL ( I essentailly just want to clear the list as I use the array.length method to determine how many elements I have in the array). However, when the code loops around and I again want to store a number in the array, it complains as the array is NULL and moans"Attempt to index array element beyond array length". So the question is how do I 'clear' the array (I dont want to put an arbitary number in there as I need to use the length method). Should I just reinitialise the array every time it needs it? Seems a bit sloppy! Thanks
|