How can I clean up an array? For example I used an array, the array is now full of data, now I need to remove all data so that I can use it again.
Any idea how I can do this? Replacing all data with 0 in a loop (the array is double) won't work it will interfere with calculations.
I need to make the array as it was before I added any info.
Would appreciate any help
Some one more experienced may correct me but as a suggestion, you could resize the array to 0 and resize it back again...
Good idea V! Thanks!
Just set the initialization value to zero.
Phil, out of interest, will that work with EMPTY_VALUE ?
good question V, I have no idea on that, needs to be investigated
If u use EMPTY_VALUE it would initialize it to the constant's value (the pre-processor simply replaces EMPTY_VALUE with it's value just before compilation):
I have still not fixed my problem.
The thing is I use the ArrayMaximum and Minimum in a loop, now if I the array have values from the previous loop, or the values are set to 0, it influences the calculations.
I need to literally remove the values, there must be NOTHING in the array.
Define NOTHING :)
The array will always contain values. You can fill your array with EMPTY_VALUE and then use ArrayMaximum (), ArrayMinimum() along with a check if max/min value is different from EMPTY_VALUE.