[fpc-devel] SetLength() vs := ''

Michael Van Canneyt michael at freepascal.org
Fri Nov 9 11:50:19 CET 2007



On Fri, 9 Nov 2007, Graeme Geldenhuys wrote:

> Hi,
> 
> Is SetLength(StringVar, 0);       faster than     StringVar := '';       ?
> 
> 
> I see quite a bit of code in fpdoc use SetLength() rather than := ''
> so I just wondered...

fpdoc was implemented in a time that ansistrings were still buggy.
That's why setlength was used.

Michael.



More information about the fpc-devel mailing list