<?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: Getting test execution error in Arcade Playground in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/getting-test-execution-error-in-arcade-playground/m-p/1503561#M85408</link>
    <description>&lt;P&gt;Thanks for responding so quickly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using it to change the title of a map within a map series.&amp;nbsp; The expected output is the formatting of a text attribute that may contain several words into multiple lines which have a set character limit.&amp;nbsp; I have a defined amount of horizontal space but not so restricted on vertical space so I'm trying to break down the title into multiple lines.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2024 14:13:06 GMT</pubDate>
    <dc:creator>Markbe_utco</dc:creator>
    <dc:date>2024-07-10T14:13:06Z</dc:date>
    <item>
      <title>Getting test execution error in Arcade Playground</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/getting-test-execution-error-in-arcade-playground/m-p/1503317#M85390</link>
      <description>&lt;P&gt;I'm getting a "Test execution error":&lt;/P&gt;&lt;P&gt;Test execution error: Execution error - Out of bounds. Verify test data&lt;/P&gt;&lt;P&gt;Ultimately this script will be used to parse down a field from the attribute table so I wrote it in the ArcGIS Arcade Playground to get a better handle on how to parse the text.&amp;nbsp; Yes I know I have lots of calls to Console, this was me trying to figure out where the problem was occurring since error message was ever so helpful.&lt;/P&gt;&lt;P&gt;I turns out the error is being cause by what I think should be a simple variable assignment line.&lt;/P&gt;&lt;P&gt;When line 56 is commented out the script actually runs, albeit not the end result that I want.&lt;/P&gt;&lt;P&gt;On Line 55&amp;nbsp; I'm trying to assign the variable &lt;EM&gt;prefix&lt;/EM&gt; a string that will be processed through the next iteration of the for loop that begins on line 31.&lt;/P&gt;&lt;P&gt;I still get the message even when Line 55 is commented out and I use Line 56 as a simple string.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var name = "12 45 78 01 34 6 IFD A"
var lenToIFD = Find(" IFD", name)
//var noIFDname = replace(name, " IFD","") 
var noIFDname = left(name, lenToIFD) 
var fullName = replace(name, "IFD", "\nInfrastructure\nFinancing\nDistrict")
var nameLen = count(name)
var arrayName = split(noIFDname, " ")
var maxLength = 14
var prefix = ""
var finalOutput = ""
var counter = 0
var prefixArray = []
var prefixArrayCounter = 0

Console(noIFDname)
console(prefix)

console(lenToIFD)
console(maxLength)
Console((arrayName))

Console("OOOOOOOOOOOOOOOOOOOOOO")
// determine district number from text at end of Plat Name
var distNum = right(name, nameLen - lenToIFD-4)

// Find text plat name before IFD 
if (lenToIFD &amp;lt;= maxLength){
  prefix = left(name,lenToIFD)
}
else{
  for (var index in arrayName){
    Console("============")
    Console(index)
    Console(counter)
    Console((prefixArrayCounter))
    Console(arrayName[index])
    if (index == counter){
      if (count(arrayName[index])&amp;lt;= maxLength){
        Console("Begin While Loop") 
        Console(count(prefix))      
        while (count(prefix)&amp;lt; maxLength){
          console(arrayName[counter])

          prefix = prefix + " " + arrayName[counter]
          counter = counter + 1
          index = counter
          Console(prefix)
        }
        Console("End While Loop")
        Console(("XXXXXXXXXXXXXXXXX"))
        console(arrayName[counter])
        prefixArray[prefixArrayCounter] = replace(prefix," ","",false)
        Console(prefixArray[prefixArrayCounter])
        var newPrefix = replace(noIFDname, prefixArray[prefixArrayCounter],"")
        prefix = newPrefix
        //prefix = "QQQ"
        Console("NewPrefix")
        Console(newPrefix)

        prefixArrayCounter = prefixArrayCounter +1
        if (index &amp;lt;= counter){
          Console("CONTINUE")
          continue
        }
      }
    }
    else{
      continue
    }
    var varTemp = replace(prefix," ","",false)

  }
}
console(prefixArray)
finalOutput = varTemp +"\nInfrastructure\nFinancing District" + distNum
return(finalOutput)&lt;/LI-CODE&gt;&lt;P&gt;What am I not seeing?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 22:19:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/getting-test-execution-error-in-arcade-playground/m-p/1503317#M85390</guid>
      <dc:creator>Markbe_utco</dc:creator>
      <dc:date>2024-07-09T22:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Getting test execution error in Arcade Playground</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/getting-test-execution-error-in-arcade-playground/m-p/1503374#M85397</link>
      <description>&lt;P&gt;It's lines 44 through 46, when you assign to &lt;STRONG&gt;prefix&lt;/STRONG&gt; the value&lt;/P&gt;&lt;PRE&gt;prefix + " " + arrayName[counter]&lt;/PRE&gt;&lt;P&gt;You increment the counter, then on the next loop, the counter has exceeded the length of the array, giving you the out of bounds warning.&lt;/P&gt;&lt;P&gt;You probably want to add some logic to catch when the counter is higher than the length of the array.&lt;/P&gt;&lt;P&gt;Out of curiosity, what is the &lt;EM&gt;expected &lt;/EM&gt;output of this example?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 03:32:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/getting-test-execution-error-in-arcade-playground/m-p/1503374#M85397</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2024-07-10T03:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Getting test execution error in Arcade Playground</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/getting-test-execution-error-in-arcade-playground/m-p/1503561#M85408</link>
      <description>&lt;P&gt;Thanks for responding so quickly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using it to change the title of a map within a map series.&amp;nbsp; The expected output is the formatting of a text attribute that may contain several words into multiple lines which have a set character limit.&amp;nbsp; I have a defined amount of horizontal space but not so restricted on vertical space so I'm trying to break down the title into multiple lines.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 14:13:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/getting-test-execution-error-in-arcade-playground/m-p/1503561#M85408</guid>
      <dc:creator>Markbe_utco</dc:creator>
      <dc:date>2024-07-10T14:13:06Z</dc:date>
    </item>
  </channel>
</rss>

