<?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: How can I combine both CLR and VBNewline in my Label Expression? in Python Snippets Questions</title>
    <link>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765416#M75</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And in the Label Expression dialog, you need to use&amp;nbsp; the \r\n pair&amp;nbsp;for a new line with Python.&amp;nbsp; It is one of the few places in Desktop where \n alone won't work as expected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Mar 2019 18:09:08 GMT</pubDate>
    <dc:creator>RandyBurton</dc:creator>
    <dc:date>2019-03-21T18:09:08Z</dc:date>
    <item>
      <title>How can I combine both CLR and VBNewline in my Label Expression?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765412#M71</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am creating a label style that needs to contain three pieces of information from three attribute fields in the feature class. In the label expression, each field needs to appear on its new line, and one field [GW_Elevati] needs to appear in blue font.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my first draft, I used only the &amp;amp;vbnewline&amp;amp; command, and it came out just fine. However, when I added in the appropriate code for coloring the font (see code below), I got this:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;Location&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;vbnewline &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"&amp;lt;CLR blue = '255'&amp;gt;"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;GW_Elevati&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"&amp;lt;/CLR&amp;gt;"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;vbnewline&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;Carbon_tet&lt;SPAN class="punctuation token"&gt;]&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;IMG alt="" class="image-1 jive-image j-img-centered j-img-original" src="https://community.esri.com/legacyfs/online/439994_FirstAttempt.PNG" style="display: block; margin-left: auto; margin-right: auto;" /&gt;&lt;/P&gt;&lt;P&gt;In the next stage, I found that if I added in a single quotation mark after the close of the CLR code, I got this result:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;Location&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;vbnewline &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"&amp;lt;CLR blue = '255'&amp;gt;"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;GW_Elevati&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"&amp;lt;/CLR&amp;gt;"&lt;/SPAN&gt;' &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;vbnewline&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;Carbon_tet&lt;SPAN class="punctuation token"&gt;]&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;IMG alt="" class="jive-image image-2 j-img-centered j-img-original" src="https://community.esri.com/legacyfs/online/439995_Capture.PNG" style="display: block; margin-left: auto; margin-right: auto;" /&gt;&lt;/P&gt;&lt;P&gt;As you can see, it colors the appropriate text, but drops off the final attribute field/text.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried opening and closing quotes around different parts of the expression, but can't seem to get the result I'm looking for. Any advice?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2019 23:26:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765412#M71</guid>
      <dc:creator>SalWebber</dc:creator>
      <dc:date>2019-03-20T23:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can I combine both CLR and VBNewline in my Label Expression?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765413#M72</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you have this in 'python snippets' there is no vb place.&amp;nbsp; If you are looking for a python newline character it is \n&lt;/P&gt;&lt;P&gt;print('a' + '\n' + 'b')&lt;BR /&gt;a&lt;BR /&gt;b&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2019 09:59:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765413#M72</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-03-21T09:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: How can I combine both CLR and VBNewline in my Label Expression?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765414#M73</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. I couldn't quite figure out where VBScript should be posted. Do you have any recommendations? I'll give the Python newline script a try as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2019 16:09:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765414#M73</guid>
      <dc:creator>SalWebber</dc:creator>
      <dc:date>2019-03-21T16:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: How can I combine both CLR and VBNewline in my Label Expression?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765415#M74</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suspect the issue might be with the &amp;lt;0.50 value in the Carbon_tet field.&amp;nbsp; You may have to escape the less-than symbol because you are using the "html-like" CLR tag.&amp;nbsp; A greater-than symbol would also need escaping.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2019 17:13:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765415#M74</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2019-03-21T17:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can I combine both CLR and VBNewline in my Label Expression?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765416#M75</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And in the Label Expression dialog, you need to use&amp;nbsp; the \r\n pair&amp;nbsp;for a new line with Python.&amp;nbsp; It is one of the few places in Desktop where \n alone won't work as expected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2019 18:09:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765416#M75</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2019-03-21T18:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: How can I combine both CLR and VBNewline in my Label Expression?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765417#M76</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ahhh python-esque then &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2019 18:11:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765417#M76</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-03-21T18:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: How can I combine both CLR and VBNewline in my Label Expression?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765418#M77</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As &lt;A href="https://community.esri.com/migrated-users/34565" target="_blank"&gt;Randy Burton&lt;/A&gt;&amp;nbsp; mentioned... your&amp;nbsp; "&amp;lt;" in the carbon field must be escaped.&amp;nbsp; In Vbscript there is no escape character as in python, for vb you must double quote the field that has the character(s) that need escaping.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;[Location]&amp;amp; vbcrlf &amp;amp; "&amp;lt;CLR blue = '255'&amp;gt;" &amp;amp; [GW_Elevati] &amp;amp; "&amp;lt;/CLR&amp;gt;" &amp;amp; vbcrlf &amp;amp; "" &amp;amp; [Carbon_tet]&amp;amp; """

# Or use the vb escape function


....  vbcrlf &amp;amp; escape([Carbon_tet]) &lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:30:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765418#M77</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2021-12-12T08:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: How can I combine both CLR and VBNewline in my Label Expression?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765419#M78</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you! This worked like a charm. I appreciate everyone's help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2019 17:04:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765419#M78</guid>
      <dc:creator>SalWebber</dc:creator>
      <dc:date>2019-03-22T17:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: How can I combine both CLR and VBNewline in my Label Expression?</title>
      <link>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765420#M79</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you! You're right on point.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Mar 2019 17:05:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-snippets-questions/how-can-i-combine-both-clr-and-vbnewline-in-my/m-p/765420#M79</guid>
      <dc:creator>SalWebber</dc:creator>
      <dc:date>2019-03-22T17:05:29Z</dc:date>
    </item>
  </channel>
</rss>

