<?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: for (var path of paths) in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-for-var-path-of-paths/m-p/1150730#M52382</link>
    <description>&lt;P&gt;In Arcade, the syntax of a for loop doesn't use "of", only "in".&lt;/P&gt;</description>
    <pubDate>Fri, 04 Mar 2022 16:53:49 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2022-03-04T16:53:49Z</dc:date>
    <item>
      <title>Arcade: for (var path of paths)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-for-var-path-of-paths/m-p/1150702#M52376</link>
      <description>&lt;P&gt;I'm attempting to use the JS from this post — in an Arcade calculation attribute rule:&amp;nbsp;&lt;A href="https://codereview.stackexchange.com/a/274613/133964" target="_self"&gt;Code Review: Modify Polyline Vertices&lt;/A&gt;&lt;/P&gt;&lt;P&gt;That script uses the following for loop:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;//This script works as standalone JS: https://jsfiddle.net/x4su7tna/&lt;BR /&gt;&lt;/SPAN&gt;var paths = [[[0,5,null],[10,10, null],[30,0, null],[50,10, null],[60,10, null]]]&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;for (var path of paths) {&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;ERROR 002717:&lt;/STRONG&gt; &lt;BR /&gt;Invalid Arcade expression, Arcade error: Syntax error in for loop, Script line: 32760&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;I get that error when I try to save the attribute rule. I think the for loop is the culprit:&amp;nbsp;&amp;nbsp;&lt;FONT face="courier new,courier" color="#0000FF"&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;path&lt;/SPAN&gt; &lt;SPAN&gt;of&lt;/SPAN&gt; &lt;SPAN&gt;paths&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;If I replace that for loop with&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier" color="#0000FF"&gt;for (var &lt;STRONG&gt;path_idx in&lt;/STRONG&gt; paths) {&lt;/FONT&gt;&amp;nbsp; , then I can successfully save:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;var paths = [[[0,5,null],[10,10, null],[30,0, null],[50,10, null],[60,10, null]]]&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;for (var path_idx in paths) {&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Question:&lt;BR /&gt;Why do I get an error when I use&amp;nbsp;&amp;nbsp;&lt;FONT face="courier new,courier" color="#0000FF"&gt;&lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;path&lt;/SPAN&gt; &lt;SPAN&gt;of&lt;/SPAN&gt; &lt;SPAN&gt;paths&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp; ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 16:18:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-for-var-path-of-paths/m-p/1150702#M52376</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-03-04T16:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade: for (var path of paths)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-for-var-path-of-paths/m-p/1150730#M52382</link>
      <description>&lt;P&gt;In Arcade, the syntax of a for loop doesn't use "of", only "in".&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 16:53:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-for-var-path-of-paths/m-p/1150730#M52382</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-03-04T16:53:49Z</dc:date>
    </item>
  </channel>
</rss>

