<?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 in ArcGIS Companion Questions</title>
    <link>https://community.esri.com/t5/arcgis-companion-questions/arcmap-vbscript/m-p/114310#M7</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Changed to &lt;/P&gt;&lt;P&gt;Function FindLabel ( [_PID], [_NAME] )&lt;BR /&gt;if [_PID] &amp;lt;&amp;gt; [_NAME] then&lt;BR /&gt;FindLabel =&amp;nbsp; [_PID] &amp;amp; "/" &amp;amp; [_NAME]&lt;BR /&gt;else &lt;BR /&gt;FindLabel =&amp;nbsp; [_PID]&lt;BR /&gt;end if&lt;BR /&gt;end function&lt;/P&gt;&lt;P&gt;Then it works.&amp;nbsp; Thanks for your review.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Dec 2018 16:45:12 GMT</pubDate>
    <dc:creator>ShaningYu</dc:creator>
    <dc:date>2018-12-24T16:45:12Z</dc:date>
    <item>
      <title>ArcMap VBScript</title>
      <link>https://community.esri.com/t5/arcgis-companion-questions/arcmap-vbscript/m-p/114309#M6</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to display Label w/ 2 fields' values like that&amp;nbsp; [_PID] &amp;amp; "/" &amp;amp; [_NAME].&amp;nbsp; Its VBScript looks like that below:&lt;/P&gt;&lt;P&gt;[_PID] &amp;amp; "/" &amp;amp; [_NAME]&lt;/P&gt;&lt;P&gt;But if [_PID] == [_NAME], I only need to display [_PID].&amp;nbsp; I tried the VBScript below:&lt;/P&gt;&lt;P&gt;Function FindLabel ( [_PID] )&lt;BR /&gt;&amp;nbsp;dim newString as string&lt;BR /&gt;&amp;nbsp;newString = ""&lt;BR /&gt;&amp;nbsp;if [_PID] == [_NAME]&amp;nbsp; then&lt;BR /&gt;&amp;nbsp; newString = [_PID]&lt;BR /&gt;else &lt;BR /&gt;&amp;nbsp; newString = [_PID] &amp;amp; "/" &amp;amp; [_NAME] &lt;BR /&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I receive error: "Carriage returns are not allowed in simple expressions".&lt;/P&gt;&lt;P&gt;How this problem can be fixed?&amp;nbsp; Thanks if you can help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Dec 2018 16:25:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-companion-questions/arcmap-vbscript/m-p/114309#M6</guid>
      <dc:creator>ShaningYu</dc:creator>
      <dc:date>2018-12-24T16:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap VBScript</title>
      <link>https://community.esri.com/t5/arcgis-companion-questions/arcmap-vbscript/m-p/114310#M7</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Changed to &lt;/P&gt;&lt;P&gt;Function FindLabel ( [_PID], [_NAME] )&lt;BR /&gt;if [_PID] &amp;lt;&amp;gt; [_NAME] then&lt;BR /&gt;FindLabel =&amp;nbsp; [_PID] &amp;amp; "/" &amp;amp; [_NAME]&lt;BR /&gt;else &lt;BR /&gt;FindLabel =&amp;nbsp; [_PID]&lt;BR /&gt;end if&lt;BR /&gt;end function&lt;/P&gt;&lt;P&gt;Then it works.&amp;nbsp; Thanks for your review.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Dec 2018 16:45:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-companion-questions/arcmap-vbscript/m-p/114310#M7</guid>
      <dc:creator>ShaningYu</dc:creator>
      <dc:date>2018-12-24T16:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: ArcMap VBScript</title>
      <link>https://community.esri.com/t5/arcgis-companion-questions/arcmap-vbscript/m-p/114311#M8</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In VBScript, you'll always get an error if you instantiate a variable as a specific object like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="line-numbers language-csharp"&gt;&lt;CODE&gt;dim newString &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to just do that like this:&lt;/P&gt;&lt;PRE class="line-numbers language-csharp"&gt;&lt;CODE&gt;dim newString &lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Dec 2018 18:57:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-companion-questions/arcmap-vbscript/m-p/114311#M8</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2018-12-26T18:57:16Z</dc:date>
    </item>
  </channel>
</rss>

