[fpc-devel] Array of Ansistring

Jason P Sage jasonpsage at jegas.org
Mon Mar 12 03:10:50 CET 2007


Hello All.

I saw a great example of using: 

MyArray:  Array of ansistring;

There is code I saw that seems to work great using: 

SetLength(MyArray,100);

Which allows MyArray[100]:='Some ansiString';

What I don't know is how to clean this up. 

Making all the 100 ansistrings in this example set to empty doesn't
Cut it, nor does trying to perform SetLength(MyArray,0);

At least not when I run tests and look at memory in use in the Win32
Task Manager in XP.

Does anyone know how to cleanly deallocate memory used in this way?

Or is this simply not a good way to code. I was drawn to it because it
seems a rather fast way to have a list of strings and to search them.
I'm counting milliseconds in my current project - so speed matters.

Thank you in advance.
Jason P Sage





More information about the fpc-devel mailing list