Re: Dyn Arrays



Alex Moore wrote:
Can I use SetLength to redimension a dynamic array.
For Instance can I do somthing like:

for I:= 1 to N do
begin
SetLength(MyArray, I);
Do Something with MyArray[I - 1];
end;

I am told that this leaks memory. Is that correct?

Thanks in advance.

alex.moore@xxxxxxxxxxx


no, it don't leak memory how ever, it could slow things down a bit
depending on how fragmented your memory pool is.

--
"I'm never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5

.