[fpc-pascal] string concatenation speed

Luiz Américo pascalive at bol.com.br
Wed Jun 22 01:53:45 CEST 2005


Michael Van Canneyt wrote:

> 
>   Len:=0;
>   For I:=X to Y do
>     Inc(Len,Length(L[i]));  // S string, L list.
>   SetLength(S,Len);
>   P:=1;
>   For I:=X to Y do
>     begin
>     T:=L[i];
>     Len:=Length(T);
>     Move(T[1],S[P],Len);
>     inc(P,Len)
>     end;
> 

This is the behavior you get using TStrings.Text property.

See TStrings.GetTextStr function

Luiz




More information about the fpc-pascal mailing list