<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: String Building Class</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2010/07/19/string-building-class/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2010/07/19/string-building-class/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Thu, 09 Feb 2012 23:42:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Moo</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/07/19/string-building-class/#comment-48142</link>
		<dc:creator>Moo</dc:creator>
		<pubDate>Wed, 21 Jul 2010 16:39:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=4050#comment-48142</guid>
		<description>&lt;p&gt;Hi folks, here&#039;s my small but very efficient class:&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container vb default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;vb codecolorer&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;Private&lt;/span&gt; m_arrBuffer&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Private&lt;/span&gt; m_strDelimiter&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Private&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; Class_Initialize()&lt;br&gt;
&#160; &#160; m_arrBuffer = Array()&lt;br&gt;
&#160; &#160; m_strDelimiter = &lt;span class=&quot;st0&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Private&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; Class_Terminate()&lt;br&gt;
&#160; &#160; m_arrBuffer = Empty&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Public&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Property&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Get&lt;/span&gt; Delimiter()&lt;br&gt;
&#160; &#160; Delimiter = m_strDelimiter&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Property&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Public&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Property&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Let&lt;/span&gt; Delimiter(strDelimiter)&lt;br&gt;
&#160; &#160; m_strDelimiter = strDelimiter&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Property&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Public&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Append&lt;/span&gt;(strValue)&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;ReDim&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Preserve&lt;/span&gt; m_arrBuffer(&lt;span class=&quot;kw1&quot;&gt;UBound&lt;/span&gt;(m_arrBuffer) + 1)&lt;br&gt;
&#160; &#160; m_arrBuffer(&lt;span class=&quot;kw1&quot;&gt;UBound&lt;/span&gt;(m_arrBuffer)) = strValue&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Public&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; AppendLine(strValue)&lt;br&gt;
&#160; &#160; Me.&lt;span class=&quot;kw1&quot;&gt;Append&lt;/span&gt; strValue &amp; vbCrLf&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Public&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; Compact()&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Not&lt;/span&gt; Me.Delimiter = &lt;span class=&quot;st0&quot;&gt;&quot;&quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; strOriginalDelimiter = Me.Delimiter&lt;br&gt;
&#160; &#160; &#160; &#160; Me.Delimiter = &lt;span class=&quot;st0&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;&lt;br&gt;
&#160; &#160; strTemp = Me.ToString&lt;br&gt;
&#160; &#160; m_arrBuffer = Array()&lt;br&gt;
&#160; &#160; Me.&lt;span class=&quot;kw1&quot;&gt;Append&lt;/span&gt; strTemp&lt;br&gt;
&#160; &#160; Me.Delimiter = strOriginalDelimiter&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Public&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; ToArray()&lt;br&gt;
&#160; &#160; ToArray = m_arrBuffer&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Public&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; ToString()&lt;br&gt;
&#160; &#160; ToString = Join(m_arrBuffer, m_strDelimiter)&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<p>Hi folks, here&#8217;s my small but very efficient class:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Private</span> m_arrBuffer<br />
<span class="kw1">Private</span> m_strDelimiter</p>
<p><span class="kw1">Private</span> <span class="kw1">Sub</span> Class_Initialize()<br />
&nbsp; &nbsp; m_arrBuffer = Array()<br />
&nbsp; &nbsp; m_strDelimiter = <span class="st0">&#8220;&#8221;</span><br />
<span class="kw1">End</span> <span class="kw1">Sub</span></p>
<p><span class="kw1">Private</span> <span class="kw1">Sub</span> Class_Terminate()<br />
&nbsp; &nbsp; m_arrBuffer = Empty<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></p>
<p><span class="kw1">Public</span> <span class="kw1">Property</span> <span class="kw1">Get</span> Delimiter()<br />
&nbsp; &nbsp; Delimiter = m_strDelimiter<br />
<span class="kw1">End</span> <span class="kw1">Property</span></p>
<p><span class="kw1">Public</span> <span class="kw1">Property</span> <span class="kw1">Let</span> Delimiter(strDelimiter)<br />
&nbsp; &nbsp; m_strDelimiter = strDelimiter<br />
<span class="kw1">End</span> <span class="kw1">Property</span></p>
<p><span class="kw1">Public</span> <span class="kw1">Sub</span> <span class="kw1">Append</span>(strValue)<br />
&nbsp; &nbsp; <span class="kw1">ReDim</span> <span class="kw1">Preserve</span> m_arrBuffer(<span class="kw1">UBound</span>(m_arrBuffer) + 1)<br />
&nbsp; &nbsp; m_arrBuffer(<span class="kw1">UBound</span>(m_arrBuffer)) = strValue<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></p>
<p><span class="kw1">Public</span> <span class="kw1">Sub</span> AppendLine(strValue)<br />
&nbsp; &nbsp; Me.<span class="kw1">Append</span> strValue &amp; vbCrLf<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></p>
<p><span class="kw1">Public</span> <span class="kw1">Sub</span> Compact()<br />
&nbsp; &nbsp; <span class="kw1">If</span> <span class="kw1">Not</span> Me.Delimiter = <span class="st0">&#8220;&#8221;</span> <span class="kw1">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; strOriginalDelimiter = Me.Delimiter<br />
&nbsp; &nbsp; &nbsp; &nbsp; Me.Delimiter = <span class="st0">&#8220;&#8221;</span><br />
&nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">If</span><br />
&nbsp; &nbsp; strTemp = Me.ToString<br />
&nbsp; &nbsp; m_arrBuffer = Array()<br />
&nbsp; &nbsp; Me.<span class="kw1">Append</span> strTemp<br />
&nbsp; &nbsp; Me.Delimiter = strOriginalDelimiter<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></p>
<p><span class="kw1">Public</span> <span class="kw1">Function</span> ToArray()<br />
&nbsp; &nbsp; ToArray = m_arrBuffer<br />
<span class="kw1">End</span> <span class="kw1">Function</span></p>
<p><span class="kw1">Public</span> <span class="kw1">Function</span> ToString()<br />
&nbsp; &nbsp; ToString = Join(m_arrBuffer, m_strDelimiter)<br />
<span class="kw1">End</span> <span class="kw1">Function</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roy MacLean</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/07/19/string-building-class/#comment-48100</link>
		<dc:creator>Roy MacLean</dc:creator>
		<pubDate>Tue, 20 Jul 2010 09:47:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=4050#comment-48100</guid>
		<description>&lt;p&gt;There are various links in the comments to this posting:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://roymacleanvba.wordpress.com/2010/01/14/performance-strings/&quot; rel=&quot;nofollow&quot;&gt;http://roymacleanvba.wordpress.com/2010/01/14/performance-strings/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;regards&lt;br&gt;
/Roy&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>There are various links in the comments to this posting:</p>
<p><a href="http://roymacleanvba.wordpress.com/2010/01/14/performance-strings/" rel="nofollow">http://roymacleanvba.wordpress.com/2010/01/14/performance-strings/</a></p>
<p>regards<br />
/Roy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fzz</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/07/19/string-building-class/#comment-48089</link>
		<dc:creator>fzz</dc:creator>
		<pubDate>Mon, 19 Jul 2010 19:36:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=4050#comment-48089</guid>
		<description>&lt;p&gt;If you&#039;re going to make an unnecessary text string class, why wouldn&#039;t you also make an unnecessary number class which including number format for string representation as one of its properties?&lt;/p&gt;
&lt;p&gt;VBA doesn&#039;t provide overloading, so if syntax checking is wanted, methods and properties can accept one and only one type for each argument. The alternative of passing arguments as variants means no SYNTAX checking, but the need to put RUNTIME type checking code into methods and properties and throw RUNTIME errors when they&#039;re passed anything invalid.&lt;/p&gt;
&lt;p&gt;VBA&#039;s object-oriented facilities are half-baked. Best avoided when possible. A text string class as a wrapper around a plain String variable is a fine example of an unnecessary and inefficient class.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>If you&#8217;re going to make an unnecessary text string class, why wouldn&#8217;t you also make an unnecessary number class which including number format for string representation as one of its properties?</p>
<p>VBA doesn&#8217;t provide overloading, so if syntax checking is wanted, methods and properties can accept one and only one type for each argument. The alternative of passing arguments as variants means no SYNTAX checking, but the need to put RUNTIME type checking code into methods and properties and throw RUNTIME errors when they&#8217;re passed anything invalid.</p>
<p>VBA&#8217;s object-oriented facilities are half-baked. Best avoided when possible. A text string class as a wrapper around a plain String variable is a fine example of an unnecessary and inefficient class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicholas Hebb</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/07/19/string-building-class/#comment-48088</link>
		<dc:creator>Nicholas Hebb</dc:creator>
		<pubDate>Mon, 19 Jul 2010 18:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=4050#comment-48088</guid>
		<description>&lt;p&gt;Oh, and I forgot to add, VBSpeed has some pretty good stuff for people who want to go waaay overboard in string handling optimization for VB/VBA:&lt;br&gt;
&lt;a href=&quot;http://www.xbeat.net/vbspeed/&quot; rel=&quot;nofollow&quot;&gt;http://www.xbeat.net/vbspeed/&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Oh, and I forgot to add, VBSpeed has some pretty good stuff for people who want to go waaay overboard in string handling optimization for VB/VBA:<br />
<a href="http://www.xbeat.net/vbspeed/" rel="nofollow">http://www.xbeat.net/vbspeed/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicholas Hebb</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/07/19/string-building-class/#comment-48087</link>
		<dc:creator>Nicholas Hebb</dc:creator>
		<pubDate>Mon, 19 Jul 2010 18:18:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=4050#comment-48087</guid>
		<description>&lt;p&gt;You may have read my comment over on Smurf&#039;s blog. My implementation is much more simplistic and was driven mainly by the need to track variables through a complicated process and spit out the results at the end, and my hate for constantly typing &quot;&amp; vbCrLf&quot;.&lt;/p&gt;
&lt;p&gt;Here is my CStringBuilderItem:&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container text default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;text codecolorer&quot;&gt;Private m_ItemText As String&lt;br&gt;
&lt;br&gt;
Public Property Get ItemText() As String&lt;br&gt;
&#160; &#160; ItemText = m_ItemText&lt;br&gt;
End Property&lt;br&gt;
&lt;br&gt;
Public Property Let ItemText(ByVal NewText As String)&lt;br&gt;
&#160; &#160; m_ItemText = NewText&lt;br&gt;
End Property&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Here is my CStringBuilder Class:&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container text default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;text codecolorer&quot;&gt;Private mCol As Collection&lt;br&gt;
&lt;br&gt;
Public Sub AddText(NewText As String, Optional sKey As String)&lt;br&gt;
&#160; &#160; Dim oSBI As CStringBuilderItem&lt;br&gt;
&#160; &#160; &lt;br&gt;
&#160; &#160; Set oSBI = New CStringBuilderItem&lt;br&gt;
&#160; &#160; oSBI.ItemText = NewText&lt;br&gt;
&#160; &#160; If Len(sKey) = 0 Then&lt;br&gt;
&#160; &#160; &#160; &#160; mCol.Add oSBI&lt;br&gt;
&#160; &#160; Else&lt;br&gt;
&#160; &#160; &#160; &#160; mCol.Add oSBI, sKey&lt;br&gt;
&#160; &#160; End If&lt;br&gt;
&#160; &#160; Set oSBI = Nothing&lt;br&gt;
&lt;br&gt;
End Sub&lt;br&gt;
&lt;br&gt;
Public Function ToString(Optional ByVal AddNewLine As Boolean = True) As String&lt;br&gt;
&#160; &#160; Dim returnValue As String&lt;br&gt;
&#160; &#160; Dim delimiter As String&lt;br&gt;
&#160; &#160; Dim i As Integer&lt;br&gt;
&#160; &#160; &lt;br&gt;
&#160; &#160; If mCol.Count = 0 Then&lt;br&gt;
&#160; &#160; &#160; &#160; returnValue = &quot;&quot;&lt;br&gt;
&#160; &#160; Else&lt;br&gt;
&#160; &#160; &#160; &#160; returnValue = mCol.Item(1).ItemText&lt;br&gt;
&#160; &#160; &#160; &#160; If mCol.Count &gt; 1 Then&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; If AddNewLine Then&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; delimiter = vbCrLf&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; Else&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; delimiter = &quot; &quot;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; End If&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; For i = 2 To mCol.Count&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; returnValue = returnValue &amp; delimiter &amp; mCol.Item(i).ItemText&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; Next&lt;br&gt;
&#160; &#160; &#160; &#160; End If&lt;br&gt;
&#160; &#160; End If&lt;br&gt;
&#160; &#160; ToString = returnValue&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;br&gt;
End Function&lt;br&gt;
&lt;br&gt;
Public Sub ClearAll()&lt;br&gt;
&#160; &#160; Dim i As Integer&lt;br&gt;
&#160; &#160; Dim ii As Integer&lt;br&gt;
&#160; &#160; ii = mCol.Count&lt;br&gt;
&#160; &#160; For i = ii To 1 Step -1&lt;br&gt;
&#160; &#160; &#160; &#160; mCol.Remove i&lt;br&gt;
&#160; &#160; Next&lt;br&gt;
End Sub&lt;br&gt;
&lt;br&gt;
Public Property Get Item(vntIndexKey As Variant) As CStringBuilderItem&lt;br&gt;
&#160; &#160; Set Item = mCol(vntIndexKey)&lt;br&gt;
End Property&lt;br&gt;
&lt;br&gt;
Public Property Get Count() As Long&lt;br&gt;
&#160; &#160; Count = mCol.Count&lt;br&gt;
End Property&lt;br&gt;
&lt;br&gt;
Public Sub Remove(vntIndexKey As Variant)&lt;br&gt;
&#160; &#160; mCol.Remove vntIndexKey&lt;br&gt;
End Sub&lt;br&gt;
&lt;br&gt;
Public Property Get NewEnum() As IUnknown&lt;br&gt;
&#160; &#160; Set NewEnum = mCol.[_NewEnum]&lt;br&gt;
End Property&lt;br&gt;
&lt;br&gt;
Private Sub Class_Initialize()&lt;br&gt;
&#160; &#160; Set mCol = New Collection&lt;br&gt;
End Sub&lt;br&gt;
&lt;br&gt;
Private Sub Class_Terminate()&lt;br&gt;
&#160; &#160; Set mCol = Nothing&lt;br&gt;
End Sub&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Again, it&#039;s nothing special, but it saves me time when writing debugging tracers.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>You may have read my comment over on Smurf&#8217;s blog. My implementation is much more simplistic and was driven mainly by the need to track variables through a complicated process and spit out the results at the end, and my hate for constantly typing &#8220;&amp; vbCrLf&#8221;.</p>
<p>Here is my CStringBuilderItem:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container text default">
<div style="white-space: nowrap;" class="text codecolorer">Private m_ItemText As String</p>
<p>Public Property Get ItemText() As String<br />
&nbsp; &nbsp; ItemText = m_ItemText<br />
End Property</p>
<p>Public Property Let ItemText(ByVal NewText As String)<br />
&nbsp; &nbsp; m_ItemText = NewText<br />
End Property</div>
</div>
<p>Here is my CStringBuilder Class:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container text default">
<div style="white-space: nowrap;" class="text codecolorer">Private mCol As Collection</p>
<p>Public Sub AddText(NewText As String, Optional sKey As String)<br />
&nbsp; &nbsp; Dim oSBI As CStringBuilderItem<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; Set oSBI = New CStringBuilderItem<br />
&nbsp; &nbsp; oSBI.ItemText = NewText<br />
&nbsp; &nbsp; If Len(sKey) = 0 Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; mCol.Add oSBI<br />
&nbsp; &nbsp; Else<br />
&nbsp; &nbsp; &nbsp; &nbsp; mCol.Add oSBI, sKey<br />
&nbsp; &nbsp; End If<br />
&nbsp; &nbsp; Set oSBI = Nothing</p>
<p>End Sub</p>
<p>Public Function ToString(Optional ByVal AddNewLine As Boolean = True) As String<br />
&nbsp; &nbsp; Dim returnValue As String<br />
&nbsp; &nbsp; Dim delimiter As String<br />
&nbsp; &nbsp; Dim i As Integer<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; If mCol.Count = 0 Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; returnValue = &#8220;&#8221;<br />
&nbsp; &nbsp; Else<br />
&nbsp; &nbsp; &nbsp; &nbsp; returnValue = mCol.Item(1).ItemText<br />
&nbsp; &nbsp; &nbsp; &nbsp; If mCol.Count &gt; 1 Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If AddNewLine Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; delimiter = vbCrLf<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; delimiter = &#8221; &#8220;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; End If<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; For i = 2 To mCol.Count<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; returnValue = returnValue &amp; delimiter &amp; mCol.Item(i).ItemText<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Next<br />
&nbsp; &nbsp; &nbsp; &nbsp; End If<br />
&nbsp; &nbsp; End If<br />
&nbsp; &nbsp; ToString = returnValue<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
End Function</p>
<p>Public Sub ClearAll()<br />
&nbsp; &nbsp; Dim i As Integer<br />
&nbsp; &nbsp; Dim ii As Integer<br />
&nbsp; &nbsp; ii = mCol.Count<br />
&nbsp; &nbsp; For i = ii To 1 Step -1<br />
&nbsp; &nbsp; &nbsp; &nbsp; mCol.Remove i<br />
&nbsp; &nbsp; Next<br />
End Sub</p>
<p>Public Property Get Item(vntIndexKey As Variant) As CStringBuilderItem<br />
&nbsp; &nbsp; Set Item = mCol(vntIndexKey)<br />
End Property</p>
<p>Public Property Get Count() As Long<br />
&nbsp; &nbsp; Count = mCol.Count<br />
End Property</p>
<p>Public Sub Remove(vntIndexKey As Variant)<br />
&nbsp; &nbsp; mCol.Remove vntIndexKey<br />
End Sub</p>
<p>Public Property Get NewEnum() As IUnknown<br />
&nbsp; &nbsp; Set NewEnum = mCol.[_NewEnum]<br />
End Property</p>
<p>Private Sub Class_Initialize()<br />
&nbsp; &nbsp; Set mCol = New Collection<br />
End Sub</p>
<p>Private Sub Class_Terminate()<br />
&nbsp; &nbsp; Set mCol = Nothing<br />
End Sub</div>
</div>
<p>Again, it&#8217;s nothing special, but it saves me time when writing debugging tracers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Tolle</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/07/19/string-building-class/#comment-48080</link>
		<dc:creator>John Tolle</dc:creator>
		<pubDate>Mon, 19 Jul 2010 14:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=4050#comment-48080</guid>
		<description>&lt;p&gt;One reason why people roll their own string building class in VBA is to get around the performance hit imposed by regular string concatenation. Each concatenation requires a string copy, so building a string by concatenation means repeatedly copying most of it. What should be a time proportional to the string length ends up taking a time proportional to the *square* of the length.&lt;/p&gt;
&lt;p&gt;You can make a very simple &quot;string appender&quot; class by just stuffing the individual strings into a Collection, and then copying them into an array and using Join() to get back your built-up string. (I&#039;ve never tested to see how Join() performs, though.)&lt;/p&gt;
&lt;p&gt;Here is a nifty example of one that uses a string buffer instead:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://stackoverflow.com/questions/1070863/hidden-features-of-vba/1338833#1338833&quot; rel=&quot;nofollow&quot;&gt;http://stackoverflow.com/questions/1070863/hidden-features-of-vba/1338833#1338833&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>One reason why people roll their own string building class in VBA is to get around the performance hit imposed by regular string concatenation. Each concatenation requires a string copy, so building a string by concatenation means repeatedly copying most of it. What should be a time proportional to the string length ends up taking a time proportional to the *square* of the length.</p>
<p>You can make a very simple &#8220;string appender&#8221; class by just stuffing the individual strings into a Collection, and then copying them into an array and using Join() to get back your built-up string. (I&#8217;ve never tested to see how Join() performs, though.)</p>
<p>Here is a nifty example of one that uses a string buffer instead:</p>
<p><a href="http://stackoverflow.com/questions/1070863/hidden-features-of-vba/1338833#1338833" rel="nofollow">http://stackoverflow.com/questions/1070863/hidden-features-of-vba/1338833#1338833</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://www.dailydoseofexcel.com/archives/2010/07/19/string-building-class/#comment-48078</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Mon, 19 Jul 2010 13:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=4050#comment-48078</guid>
		<description>&lt;p&gt;Dick -&lt;/p&gt;
&lt;p&gt;Why roll your own?&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container vb default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;vb codecolorer&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;Public&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Property&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Get&lt;/span&gt; Reverse()&lt;br&gt;
&#160; &#160;&lt;br&gt;
&#160; &#160; Reverse = StrReverse(mstext)&lt;br&gt;
&#160; &#160;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Property&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;...mrt&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Dick -</p>
<p>Why roll your own?</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Public</span> <span class="kw1">Property</span> <span class="kw1">Get</span> Reverse()<br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; Reverse = StrReverse(mstext)<br />
&nbsp; &nbsp;<br />
<span class="kw1">End</span> <span class="kw1">Property</span></div>
</div>
<p>&#8230;mrt</p>
]]></content:encoded>
	</item>
</channel>
</rss>

