I have program where I have to create strings for more than 400,000 times and 
write them to a stream.

as an example the following: 

var
astring, and bstring,... : string;

passing this to a stream could be done with:

procedure WriteText(const AString: string);
begin
  FStream.Write(PChar(AString)^, Length(AString));
end;

I have two options to save this to the stream:

1. write the list of strings one by one to the stream.. 
writestring(astring);
writestring('  ');
writestring(bstring);
...

2. concatenatie the strings to one new string and then write the resulting 
string to the stream.
( 

 lstring := astring + '  ' + bstring + '  ' +cstring etc; 

 writetext(lstring);

)

At first the second solution seems to be faster (using a stopwatch), but mayube 
there is a drawback.

what is the fastest way to concatenate stings and to pass then to a TStream?

Thanks in advance




 
____________________________________________________________________________________
Never Miss an Email
Stay connected with Yahoo! Mail on your mobile.  Get started!
http://mobile.yahoo.com/services?promote=mail

[Non-text portions of this message have been removed]

Reply via email to