<?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: Arcade expression error in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1496846#M7084</link>
    <description>&lt;P&gt;When posting code, don't use an image. Use the "&lt;A href="https://community.esri.com/t5/community-help-documents/how-to-insert-code-in-your-post/ta-p/914552" target="_self"&gt;Insert/Edit code sample&lt;/A&gt;" button. This makes it easier for us to read and copy it to check syntax.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jun 2024 20:16:36 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2024-06-24T20:16:36Z</dc:date>
    <item>
      <title>Arcade expression error</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1496843#M7083</link>
      <description>&lt;P&gt;I am new to creating expressions in arcade. I don't know what I am missing. I am trying to create an expression for labeling roads. I keep getting "invalid expression error on line 10 semicolon or new line expected." I do have the "Remove extra spaces" and "Remove extra line breaks" checked too. Any advice or suggestions on how to fix this. I would appreciate it.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var words= split(upper([$feature.featurename])," ")
var upperWords=["N","NW","W","SW","S","SE","E","NE","US"]
var lowerWords=["1ST","2ND","3RD","4TH","5TH","6TH","7TH","8TH","9TH","0TH","1TH","2TH","3TH"]
var label= ""
for (var word in words)
{
 var isUpper= indexof(upperWords, words[word]) &amp;gt;-1 
 var isLower= indexof(lowerWords, words[word]) &amp;gt;-1
 if (isUpper)
  label + "" words[word]+""
 else if (isLower)
  label + "" lower(word[words]) + " "
 else
  label + "" proper(words[word]) + " "
 }

return label&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 24 Jun 2024 21:33:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1496843#M7083</guid>
      <dc:creator>KimberlyMoran</dc:creator>
      <dc:date>2024-06-24T21:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression error</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1496846#M7084</link>
      <description>&lt;P&gt;When posting code, don't use an image. Use the "&lt;A href="https://community.esri.com/t5/community-help-documents/how-to-insert-code-in-your-post/ta-p/914552" target="_self"&gt;Insert/Edit code sample&lt;/A&gt;" button. This makes it easier for us to read and copy it to check syntax.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 20:16:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1496846#M7084</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-06-24T20:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression error</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1496848#M7085</link>
      <description>&lt;P&gt;You need curly braces around your if/elseif/else blocks:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;if (isUpper) {
  ...
} else if (isLower) {
  ...
} else {
  ...
}

return label&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll probably want to use &lt;STRONG&gt;label += &lt;/STRONG&gt;to actually change the value of the variable, too.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 20:20:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1496848#M7085</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2024-06-24T20:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression error</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1496859#M7086</link>
      <description>&lt;P&gt;You don't need curly braces for one line if/else statements (although they are good for avoiding confusion). This expression works properly&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var words = ['n', '1st', 'ave']
var upperWords = ['N','W']
var lowerWords = ['1st', '2nd']
var label = ''
for (var word in words) 
{
  var isUpper = IndexOf(upperWords, words[word]) &amp;gt; -1
  var isLower = IndexOf(lowerWords, words[word]) &amp;gt; -1
  if (isUpper)
    label += words[word] + ' '
  else if (isLower)
    label += lower(words[word]) + ' '
  else
    label += proper(words[word]) + ' '
}
return label&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;returning &lt;SPAN class=""&gt;"N 1st Ave "&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 20:38:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1496859#M7086</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-06-24T20:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression error</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1496860#M7087</link>
      <description>&lt;P&gt;The error is caused by a missing "+" after the first double quotes in line 10 (and line 12 and 14).&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 20:40:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1496860#M7087</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-06-24T20:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression error</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1496879#M7088</link>
      <description>&lt;P&gt;Thank you. It worked.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 21:55:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1496879#M7088</guid>
      <dc:creator>KimberlyMoran</dc:creator>
      <dc:date>2024-06-24T21:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression error</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1497065#M7089</link>
      <description>&lt;P&gt;Well, I learned something new today! Had no idea that one-liners could go without braces. But one-liners can usually be replaced with Decode or When anyway.&lt;/P&gt;&lt;P&gt;I'm sure there's a JS-based reason this is the case, but I just don't like arbitrarily changing my formatting like that. Like, given the choice between an option that always works and an option that sometimes works, I'm gonna go with the former. Still neat, though!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 12:00:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1497065#M7089</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2024-06-25T12:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression error</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1497089#M7090</link>
      <description>&lt;P&gt;Don't forget to click "Accept as Solution" button on the post(s) that answered your question.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 13:25:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1497089#M7090</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-06-25T13:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expression error</title>
      <link>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1500399#M7099</link>
      <description>&lt;P&gt;How would I change the following? Currently I have O'conner Cres, I need to make the C capitalized.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 16:10:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/arcade-expression-error/m-p/1500399#M7099</guid>
      <dc:creator>KimberlyMoran</dc:creator>
      <dc:date>2024-07-02T16:10:44Z</dc:date>
    </item>
  </channel>
</rss>

