<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Label Expression Help in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/label-expression-help/m-p/702912#M18827</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Address have separators? If is true, better use Split Function, the Split Function divide the text in array, and you can Count the total elements, i.e.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Dim cElement As Variant
Dim Element2 As String
Dim mCount As Long

Element2 = "1 2 3 4 5 6 "
cElement = Split(Element2, " ")
mCount = UBound(cElement) // 6 Numbers
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the last element no have the space, you can add it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now you can use too the Mid$ function in a while i.e.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Dim tTotal As Long
Dim iCount As Long

mCount = 1
Element2 = "1 2 3 4 5 6 "
Element2 = Element2 &amp;amp; Element2
Element2 = Element2 &amp;amp; Element2
Element2 = Element2 &amp;amp; Element2
Element2 = Element2 &amp;amp; Element2
Element2 = Element2 &amp;amp; Element2
iCount = 0
tTotal = Len(Element2)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
While (mCount &amp;lt; tTotal)
&amp;nbsp;&amp;nbsp;&amp;nbsp; cElement = Mid$(Element2, mCount, 23)
&amp;nbsp;&amp;nbsp;&amp;nbsp; iCount = iCount + 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; mCount = mCount + 23
Wend
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
MsgBox iCount
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 05:33:50 GMT</pubDate>
    <dc:creator>HeribertoMantilla_Santamaría</dc:creator>
    <dc:date>2021-12-12T05:33:50Z</dc:date>
    <item>
      <title>Label Expression Help</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/label-expression-help/m-p/702911#M18826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was wondering if anyone could help me on a labeling VB expression that took duplicate values, say from an address field, and assigned a number of how many duplicate values there are to that point. The point in my case would be a water meter attached to a parcel that has many water meters with the same address, but needs a label saying how many there are in that parcel. I would appreciate any help. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks so much,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Brett Rosso &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;*Here is the code that I have wrote so far, that i cannot get to work because im not a professional code writer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Function FindLabel ( [ADDRESS] )&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FindLabel = Counter ( [ADDRESS] )&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;End Function&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Function Counter (address) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim PATTERN, Reg_exp&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set reg_exp = New RegExp&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;reg_exp.Execute = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PATTERN = "\s{23,}"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'23 max characters in the Address field&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;reg_exp.pattern = PATTERN&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;result = PATTERN.items.count&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Counter = result&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;End Function &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;*I am trying it through a spatial join at the moment, but will still accept help on creating an expression.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 13:23:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/label-expression-help/m-p/702911#M18826</guid>
      <dc:creator>BrettRosso</dc:creator>
      <dc:date>2010-09-22T13:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: Label Expression Help</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/label-expression-help/m-p/702912#M18827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Address have separators? If is true, better use Split Function, the Split Function divide the text in array, and you can Count the total elements, i.e.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Dim cElement As Variant
Dim Element2 As String
Dim mCount As Long

Element2 = "1 2 3 4 5 6 "
cElement = Split(Element2, " ")
mCount = UBound(cElement) // 6 Numbers
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the last element no have the space, you can add it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now you can use too the Mid$ function in a while i.e.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Dim tTotal As Long
Dim iCount As Long

mCount = 1
Element2 = "1 2 3 4 5 6 "
Element2 = Element2 &amp;amp; Element2
Element2 = Element2 &amp;amp; Element2
Element2 = Element2 &amp;amp; Element2
Element2 = Element2 &amp;amp; Element2
Element2 = Element2 &amp;amp; Element2
iCount = 0
tTotal = Len(Element2)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
While (mCount &amp;lt; tTotal)
&amp;nbsp;&amp;nbsp;&amp;nbsp; cElement = Mid$(Element2, mCount, 23)
&amp;nbsp;&amp;nbsp;&amp;nbsp; iCount = iCount + 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; mCount = mCount + 23
Wend
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
MsgBox iCount
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:33:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/label-expression-help/m-p/702912#M18827</guid>
      <dc:creator>HeribertoMantilla_Santamaría</dc:creator>
      <dc:date>2021-12-12T05:33:50Z</dc:date>
    </item>
  </channel>
</rss>

