I have a large 2 dimensional dynamic array of doubles.
I want to "crop" it in an elegant way, e.g. use a function SetDimensions(xstart, ystart, xend, yend) on it. Now the "high" end is no problem, I can just call SetLength(myDynArray, xend, yend) and it will either enlarge or reduce the size of the array to what I want. But how do I do it at the "low" end? i.e. how do I release the memory for the first 10 rows and columns of my array?
I could iterate through all the elements and copy them into a new array, and then trash the original, but that is not so elegant.
Any suggestions appreciated.
I want to "crop" it in an elegant way, e.g. use a function SetDimensions(xstart, ystart, xend, yend) on it. Now the "high" end is no problem, I can just call SetLength(myDynArray, xend, yend) and it will either enlarge or reduce the size of the array to what I want. But how do I do it at the "low" end? i.e. how do I release the memory for the first 10 rows and columns of my array?
I could iterate through all the elements and copy them into a new array, and then trash the original, but that is not so elegant.
Any suggestions appreciated.