<?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 How to use  Code Snippet? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-code-snippet/m-p/13560288#M62922</link>
    <description>&lt;P&gt;&lt;I&gt;[ FlexSim 21.2.0 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;DIV class="fr-view clearfix"&gt;
  &lt;P&gt;I would like to write box entry time to global table, but if product has been processed, the entry time would be write to Column 8 of the table; &lt;SPAN style="color: rgb(65, 65, 65); font-family: sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;if has not been processed, the entry time would be write to Column 4 of the table. I use an integer "tempCol" to distinguish which column should be written to, but seems not work in Write To a GlobalTable Trigger. &lt;SPAN style="color: rgb(65, 65, 65); font-family: sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;May I use Code Snippet like this?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: rgb(65, 65, 65); font-family: sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;&lt;SPAN style="color: rgb(65, 65, 65); font-family: sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="圖片.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1507223i018CFA04363A28A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="圖片.png" alt="圖片.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Tue, 31 Aug 2021 00:42:35 GMT</pubDate>
    <dc:creator>shanice_c</dc:creator>
    <dc:date>2021-08-31T00:42:35Z</dc:date>
    <item>
      <title>How to use  Code Snippet?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-code-snippet/m-p/13560288#M62922</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 21.2.0 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;DIV class="fr-view clearfix"&gt;
  &lt;P&gt;I would like to write box entry time to global table, but if product has been processed, the entry time would be write to Column 8 of the table; &lt;SPAN style="color: rgb(65, 65, 65); font-family: sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;if has not been processed, the entry time would be write to Column 4 of the table. I use an integer "tempCol" to distinguish which column should be written to, but seems not work in Write To a GlobalTable Trigger. &lt;SPAN style="color: rgb(65, 65, 65); font-family: sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;May I use Code Snippet like this?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: rgb(65, 65, 65); font-family: sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;&lt;SPAN style="color: rgb(65, 65, 65); font-family: sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="圖片.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1507223i018CFA04363A28A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="圖片.png" alt="圖片.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 31 Aug 2021 00:42:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-code-snippet/m-p/13560288#M62922</guid>
      <dc:creator>shanice_c</dc:creator>
      <dc:date>2021-08-31T00:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to use  Code Snippet?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-code-snippet/m-p/13560289#M62923</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Those two popups have different scope and so you can't define a variable in one and use it in the other. You could assign the value to a label on the item (item.TempCol = 4) and then read it off in the global table popup (item.TempCol).&lt;/P&gt;&lt;P&gt;Or instead of using the Write to a Global Table option, just write the single line of code it takes to write to a global table in the code snippet:&lt;/P&gt;&lt;PRE&gt;Table("CSTTimeTable")[item.TableRow][tempCol] = Model.time;&lt;/PRE&gt;&lt;P&gt;OR instead of using the Code Snippet, just write a single line in the Column field of the Write to a Global Table option:&lt;/P&gt;&lt;PRE&gt;item.StageComplete ? 8 : 4&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 31 Aug 2021 04:40:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-code-snippet/m-p/13560289#M62923</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2021-08-31T04:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to use  Code Snippet?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-code-snippet/m-p/13560290#M62924</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/87/matthew.g.html"&gt;@Matthew Gillespie&lt;/A&gt; Thank you for the quick response! &lt;/P&gt;
 &lt;P&gt;May I ask if there's &lt;SPAN style="color: rgb(65, 65, 65); font-family: sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;limitation for &lt;/SPAN&gt;number of triggers that could be used ? I use many triggers to record some information, and sometimes find some triggers I've set disappeared.(ex: some values that should be written to a cell is not written out, I checked through and found the last 1 or 2 triggers didn't exist there.&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 31 Aug 2021 07:54:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-code-snippet/m-p/13560290#M62924</guid>
      <dc:creator>shanice_c</dc:creator>
      <dc:date>2021-08-31T07:54:21Z</dc:date>
    </item>
  </channel>
</rss>

