<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hey Ross, how big are you talking here?, the string 
management routines are pretty optimized?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>You could consider instead using a tmemorystream 
and writing it to that when you need to ?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>What sort of sizes are you dealing with in total 
?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Matt.</FONT></DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=ross@stationplaylist.com href="mailto:ross@stationplaylist.com">Ross 
  Levis</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=delphi@ns3.123.co.nz 
  href="mailto:delphi@ns3.123.co.nz">NZ Borland Developers Group - Delphi 
  List</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Saturday, September 04, 2004 9:48 
  PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [DUG] Fast String 
  concatenation</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=Arial size=2>Hi all</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>I need a fast/efficient way&nbsp;of building a 
  string from data within a loop.&nbsp;&nbsp;The string is getting longer and 
  longer and therefore reallocating the whole string in memory every loop.&nbsp; 
  Each loop it gets&nbsp;a few&nbsp;words added, perhaps an average of&nbsp;30 
  bytes.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>I thought of doing a SetLength on the string 
  every 256 bytes or so, but I'm not sure of the best method 
  of&nbsp;moving&nbsp;the data into the correct position&nbsp;in the 
  string.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Any suggestions?</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Cheers,</FONT></DIV>
  <DIV><FONT face=Arial size=2>Ross.</FONT></DIV>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>Delphi mailing 
  list<BR>Delphi@ns3.123.co.nz<BR>http://ns3.123.co.nz/mailman/listinfo/delphi<BR></BLOCKQUOTE></BODY></HTML>