<?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: Arcmap VBScript: Replace multiple values in one label in Mapping Questions</title>
    <link>https://community.esri.com/t5/mapping-questions/arcmap-vbscript-replace-multiple-values-in-one/m-p/579586#M6315</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you're just trying to label the features as "HIGH" or "LOW", you don't need to use Replace at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function FindLabel ([TYPECD] )&lt;BR /&gt;&amp;nbsp; if ([TYPECD] = "Y") then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FindLabel = "HIGH"&lt;/P&gt;&lt;P&gt;&amp;nbsp; elseif ([TYPECD] = "N") then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FindLable = "LOW"&lt;/P&gt;&lt;P&gt;&amp;nbsp; end if&lt;BR /&gt;End Function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 May 2017 19:30:32 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2017-05-30T19:30:32Z</dc:date>
    <item>
      <title>Arcmap VBScript: Replace multiple values in one label</title>
      <link>https://community.esri.com/t5/mapping-questions/arcmap-vbscript-replace-multiple-values-in-one/m-p/579585#M6314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have&amp;nbsp;a polygon shapefile of land units with dozens of attributes. I use multiple attributes to label each land unit. One attribute has three possible values: "Y", "N", or " " (not NULL). &lt;/P&gt;&lt;P&gt;If possible, in a single label string, I would like to replace the "Y" and the "N" with different text. For example:&lt;/P&gt;&lt;P&gt;"Y" = "HIGH"&lt;/P&gt;&lt;P&gt;"N" = "LOW"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been able to replace one or the other successfully using a variety of different VBScripts such as this one:&lt;/P&gt;&lt;P&gt;Function FindLabel ([TYPECD] )&lt;BR /&gt;&amp;nbsp; FindLabel = Replace([TYPECD],"Y","HIGH") &amp;amp; Replace([TYPECD],"N","LOW")&lt;BR /&gt;End Function&lt;/P&gt;&lt;P&gt;However, the result is a label that has BOTH values in it. Example: "&amp;nbsp;HIGH Y" or "N LOW"&lt;/P&gt;&lt;P&gt;Is there a way to nest REPLACE within itself so that it replaces both "Y" and "N"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternately, is there a way have one string ignore all other content besides the value I am replacing? For example, if I do HIGHStr = Replace([TYPECD],"Y","HIGH")&amp;nbsp; &lt;EM&gt;and ignore everything else&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;LOWStr = Replace([TYPECD],"N","LOW")&lt;EM&gt; and ignore everything else&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Then I could just use FindLabel = HIGHStr &amp;amp; LOWStr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know I could achieve this by defining classes of features and labeling them differently. However, I am trying to implement this labeling across many layers in many different maps, so loading a single expression would go much faster.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 19:17:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/arcmap-vbscript-replace-multiple-values-in-one/m-p/579585#M6314</guid>
      <dc:creator>RebeccaHowser</dc:creator>
      <dc:date>2017-05-30T19:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: Arcmap VBScript: Replace multiple values in one label</title>
      <link>https://community.esri.com/t5/mapping-questions/arcmap-vbscript-replace-multiple-values-in-one/m-p/579586#M6315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you're just trying to label the features as "HIGH" or "LOW", you don't need to use Replace at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function FindLabel ([TYPECD] )&lt;BR /&gt;&amp;nbsp; if ([TYPECD] = "Y") then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FindLabel = "HIGH"&lt;/P&gt;&lt;P&gt;&amp;nbsp; elseif ([TYPECD] = "N") then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FindLable = "LOW"&lt;/P&gt;&lt;P&gt;&amp;nbsp; end if&lt;BR /&gt;End Function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 May 2017 19:30:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/arcmap-vbscript-replace-multiple-values-in-one/m-p/579586#M6315</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2017-05-30T19:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Arcmap VBScript: Replace multiple values in one label</title>
      <link>https://community.esri.com/t5/mapping-questions/arcmap-vbscript-replace-multiple-values-in-one/m-p/579587#M6316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excellent! A perfect, elegant solution. Thank you. I was thinking about the&lt;/P&gt;&lt;P&gt;problem in the wrong way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Rebecca Howser&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;"&lt;STRONG&gt;All living things on earth are kindred.&lt;/STRONG&gt;" ~Edward Abbey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 May 2017 13:45:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/arcmap-vbscript-replace-multiple-values-in-one/m-p/579587#M6316</guid>
      <dc:creator>RebeccaHowser</dc:creator>
      <dc:date>2017-05-31T13:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Arcmap VBScript: Replace multiple values in one label</title>
      <link>https://community.esri.com/t5/mapping-questions/arcmap-vbscript-replace-multiple-values-in-one/m-p/579588#M6317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad to help. Don't forget to mark the question as answered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 May 2017 14:00:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/mapping-questions/arcmap-vbscript-replace-multiple-values-in-one/m-p/579588#M6317</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2017-05-31T14:00:25Z</dc:date>
    </item>
  </channel>
</rss>

