<?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 Strange Flexscript exception. in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/strange-flexscript-exception/m-p/13546193#M51876</link>
    <description>&lt;P&gt;&lt;I&gt;[ FlexSim 17.1.4 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;I have encountered a rather disconcerting error in my current model. When running a specific code loop, the script quits unexpectedly with an exception when using continue. I thought it might be due to some of these weird errors and faulty behavior that creeps in over time when making large models, so I copied a few tables and the script to a new model, but the same thing occurred. &lt;/P&gt;&lt;P&gt;Please see the attached model: The script in the scripting window runs a loop with two &lt;STRONG&gt;if (expression) continue;&lt;/STRONG&gt; clauses in them. But at certain points the code quits when reaching these continue clauses. Not only is it a problem in this specific code, but it shakes my trust in the overall stability of flexsim coding. What if similar behavior happens in other places?&lt;/P&gt;&lt;P&gt;The error occurs on line 30 after the loop has run to 944 iterations, so to catch it a break point is set on line 14. What is really strange is that if I comment line 18 (it does nothing in the script logic anyway) the error starts occurring on every iteration but on line 22 instead.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="8157-screenshot-2.jpg"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1495861i862841EC2A1C1B15/image-size/large?v=v2&amp;amp;px=999" role="button" title="8157-screenshot-2.jpg" alt="8157-screenshot-2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A id="8158" href="https://answers.flexsim.com/storage/attachments/8158-looperrormodel.fsm"&gt;looperrormodel.fsm&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Aug 2017 12:24:55 GMT</pubDate>
    <dc:creator>MBJEBZSRG</dc:creator>
    <dc:date>2017-08-21T12:24:55Z</dc:date>
    <item>
      <title>Strange Flexscript exception.</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/strange-flexscript-exception/m-p/13546193#M51876</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 17.1.4 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;I have encountered a rather disconcerting error in my current model. When running a specific code loop, the script quits unexpectedly with an exception when using continue. I thought it might be due to some of these weird errors and faulty behavior that creeps in over time when making large models, so I copied a few tables and the script to a new model, but the same thing occurred. &lt;/P&gt;&lt;P&gt;Please see the attached model: The script in the scripting window runs a loop with two &lt;STRONG&gt;if (expression) continue;&lt;/STRONG&gt; clauses in them. But at certain points the code quits when reaching these continue clauses. Not only is it a problem in this specific code, but it shakes my trust in the overall stability of flexsim coding. What if similar behavior happens in other places?&lt;/P&gt;&lt;P&gt;The error occurs on line 30 after the loop has run to 944 iterations, so to catch it a break point is set on line 14. What is really strange is that if I comment line 18 (it does nothing in the script logic anyway) the error starts occurring on every iteration but on line 22 instead.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="8157-screenshot-2.jpg"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1495861i862841EC2A1C1B15/image-size/large?v=v2&amp;amp;px=999" role="button" title="8157-screenshot-2.jpg" alt="8157-screenshot-2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A id="8158" href="https://answers.flexsim.com/storage/attachments/8158-looperrormodel.fsm"&gt;looperrormodel.fsm&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 12:24:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/strange-flexscript-exception/m-p/13546193#M51876</guid>
      <dc:creator>MBJEBZSRG</dc:creator>
      <dc:date>2017-08-21T12:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Strange Flexscript exception.</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/strange-flexscript-exception/m-p/13546194#M51877</link>
      <description>&lt;P&gt;The issue is with the new compiled FlexScript debugger.&lt;/P&gt;&lt;P&gt;When you aren't debugging, this code is compiling and executing correctly.&lt;/P&gt;&lt;P&gt;When you are debugging, the program is compiling and executing each statement one at a time. The code for continuing in the for() loop is not correctly handling the local Table reference (cellTab) defined within the loop's scope but after the continue statement.&lt;/P&gt;&lt;P&gt;I'll add a case to the development list to fix this bug.&lt;/P&gt;&lt;P&gt;In the meantime, you can get around this bug by moving your Table cellTable declaration outside of the for() loop scope or above the continue statements within the for() loop scope.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 13:37:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/strange-flexscript-exception/m-p/13546194#M51877</guid>
      <dc:creator>philboboADSK</dc:creator>
      <dc:date>2017-08-21T13:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Strange Flexscript exception.</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/strange-flexscript-exception/m-p/13546195#M51878</link>
      <description>&lt;P&gt;Thanks Phil! I would have never discovered this on my own. I appears that there are still a few issues about creating tables in nodes other than actual tables. I tried to create a table with some rather large values in a token-label and consistently caused flexsim to crash when I clicked the token. &lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2017 10:45:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/strange-flexscript-exception/m-p/13546195#M51878</guid>
      <dc:creator>MBJEBZSRG</dc:creator>
      <dc:date>2017-08-24T10:45:25Z</dc:date>
    </item>
  </channel>
</rss>

