<?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: Flexscript Error: syntax error, unexpected ':', expecting end of code in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/flexscript-error-syntax-error-unexpected-expecting-end-of-code/m-p/13516195#M28085</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;
 Got it, thanks!
&lt;/DIV&gt;</description>
    <pubDate>Mon, 06 Dec 2021 14:11:43 GMT</pubDate>
    <dc:creator>maryamh11</dc:creator>
    <dc:date>2021-12-06T14:11:43Z</dc:date>
    <item>
      <title>Flexscript Error: syntax error, unexpected ':', expecting end of code</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/flexscript-error-syntax-error-unexpected-expecting-end-of-code/m-p/13516191#M28081</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 21.2.4 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Beta 2022&lt;/P&gt;
 &lt;P&gt;&lt;SPAN style="color: rgb(124, 112, 107);"&gt;&lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/46558-model-global-table-times.fsm" target="_blank"&gt;Model_global_table_times.fsm&lt;/A&gt;Version Beta 2022&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;Hello,&lt;/P&gt;
 &lt;P&gt;I've set a global table to be able to read specific times from there and do a calculation. The type of the cells are set as string in that column, but I am constantly getting this error:&lt;/P&gt;
 &lt;P&gt;&lt;SPAN style="color: rgb(235, 107, 86);"&gt;syntax error, unexpected ':', expecting end of code&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;&lt;SPAN style="color: rgb(235, 107, 86);"&gt;Could not finish parsing because of previous errors.&lt;/SPAN&gt;&lt;/P&gt;
 &lt;P&gt;Can anyone help to solve this?&lt;/P&gt;
 &lt;P&gt;A snippet of the model is attached.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 04 Dec 2021 01:10:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/flexscript-error-syntax-error-unexpected-expecting-end-of-code/m-p/13516191#M28081</guid>
      <dc:creator>maryamh11</dc:creator>
      <dc:date>2021-12-04T01:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Flexscript Error: syntax error, unexpected ':', expecting end of code</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/flexscript-error-syntax-error-unexpected-expecting-end-of-code/m-p/13516192#M28082</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;"executeCell()" interprets the content of the cell as FlexScript, leading to the error. And in your custom code you are trying to subtract two strings from each other (third column value). That is not a valid operation. &lt;/P&gt;&lt;P&gt;If you want to get a difference between two times of day, I'd suggest to use the Model.dateTime class. &lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.flexsim.com/en/21.2/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/DateTime.html"&gt;https://docs.flexsim.com/en/21.2/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/DateTime.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The properties "hour", "minute", "second" and "millisecond" allow you convert the current time of day into a decimal number that can then be compared to a given time in the table.&lt;/P&gt;&lt;P&gt;For example, instead of 08:00:00, you simply write 8 (as a number) into the table.&lt;/P&gt;&lt;PRE&gt;Model.dateTime.hour + Model.dateTime.minute/60 + Model.dateTime.second/3600&lt;/PRE&gt;&lt;P&gt;will give you the current time of day (for example 8.607 for 08:36:25). Then you can get the time difference as 0.607 hours.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 04 Dec 2021 08:59:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/flexscript-error-syntax-error-unexpected-expecting-end-of-code/m-p/13516192#M28082</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2021-12-04T08:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Flexscript Error: syntax error, unexpected ':', expecting end of code</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/flexscript-error-syntax-error-unexpected-expecting-end-of-code/m-p/13516193#M28083</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;A rel="user" href="https://answers.flexsim.com/users/19365/felixmh.html" nodeid="19365"&gt;@Felix Möhlmann&lt;/A&gt; Thanks for the answer! 
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;If the time difference value leads to a negative value and I use that value in the "Delay" activity does the Delay activity take into account the negative values as 0? &lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sun, 05 Dec 2021 01:20:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/flexscript-error-syntax-error-unexpected-expecting-end-of-code/m-p/13516193#M28083</guid>
      <dc:creator>maryamh11</dc:creator>
      <dc:date>2021-12-05T01:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: Flexscript Error: syntax error, unexpected ':', expecting end of code</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/flexscript-error-syntax-error-unexpected-expecting-end-of-code/m-p/13516194#M28084</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Yes, negative values will be treated as 0 in a delay activity. In other places (for example the quantity field of a "Create Tokens" activity) a negative value might lead to errors. To be save you can use "Math.max(value, 0)" to return 0 if the value is negative.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 05 Dec 2021 09:06:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/flexscript-error-syntax-error-unexpected-expecting-end-of-code/m-p/13516194#M28084</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2021-12-05T09:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Flexscript Error: syntax error, unexpected ':', expecting end of code</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/flexscript-error-syntax-error-unexpected-expecting-end-of-code/m-p/13516195#M28085</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Got it, thanks!
&lt;/DIV&gt;</description>
      <pubDate>Mon, 06 Dec 2021 14:11:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/flexscript-error-syntax-error-unexpected-expecting-end-of-code/m-p/13516195#M28085</guid>
      <dc:creator>maryamh11</dc:creator>
      <dc:date>2021-12-06T14:11:43Z</dc:date>
    </item>
  </channel>
</rss>

