<?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: How to use label values to reference global table rows in a subflow? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-label-values-to-reference-global-table-rows-in-a/m-p/13519676#M30855</link>
    <description>&lt;PRE&gt;token.Indexx&lt;/PRE&gt;&lt;P&gt;is already returning the value of the Indexx label. &lt;/P&gt;&lt;P&gt;You can just use the name of the label to get and set the label's value:&lt;/P&gt;&lt;PRE&gt;int value = token.Indexx;
token.Indexx = 5;&lt;/PRE&gt;&lt;P&gt;You only use the .value property on treenodes. You can access the treenode of a label using the labels property:&lt;/P&gt;&lt;PRE&gt;int value = token.labels["Indexx"].value;
token.labels["Indexx"].value = 5;&lt;/PRE&gt;</description>
    <pubDate>Thu, 17 May 2018 20:52:55 GMT</pubDate>
    <dc:creator>Matthew_Gillespie</dc:creator>
    <dc:date>2018-05-17T20:52:55Z</dc:date>
    <item>
      <title>How to use label values to reference global table rows in a subflow?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-label-values-to-reference-global-table-rows-in-a/m-p/13519674#M30853</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 18.0.3 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;the following image describes the labels used in subflow.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="11954-runsubflow.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1497006i9A0A0E88564AE053/image-size/large?v=v2&amp;amp;px=999" role="button" title="11954-runsubflow.png" alt="11954-runsubflow.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;the label name Indexx, has a value of 1.00. when the code shown bello is executed the error message pops up saying &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;"FlexScript exception: cannot access value property on non-treenode Variant at MODEL:/Tools/ProcessFlow/ProcessFlow/Custom Code&amp;gt;variables/codeNode"&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="11955-customcode.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1497008i559EBE7BEA5F4DD1/image-size/large?v=v2&amp;amp;px=999" role="button" title="11955-customcode.png" alt="11955-customcode.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;code :&lt;/P&gt;
&lt;PRE&gt;/**Custom Code*/
Object current = param(1);
treenode activity = param(2);
Token token = param(3);
treenode processFlow = ownerobject(activity);

Variant reel1 = Table("TerminalCount")[token.Indexx.value][2];
Variant reel2 = Table("TerminalCount")[token.Indexx.value][3];
Variant NoofTerminals = Table("TerminalPerModule")[token.Indexx.value][2];
if(reel1 &amp;gt; NoofTerminals)
{
	reel1 = reel1 - NoofTerminals;
}
else
{
	reel2 = reel2 - NoofTerminals;
}
&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 May 2018 20:46:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-label-values-to-reference-global-table-rows-in-a/m-p/13519674#M30853</guid>
      <dc:creator>pinakin_k</dc:creator>
      <dc:date>2018-05-17T20:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to use label values to reference global table rows in a subflow?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-label-values-to-reference-global-table-rows-in-a/m-p/13519675#M30854</link>
      <description>&lt;P&gt;Remove .value after token.Indexx everywhere in the code and that should fix it.&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 20:52:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-label-values-to-reference-global-table-rows-in-a/m-p/13519675#M30854</guid>
      <dc:creator>joshua_s</dc:creator>
      <dc:date>2018-05-17T20:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to use label values to reference global table rows in a subflow?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-label-values-to-reference-global-table-rows-in-a/m-p/13519676#M30855</link>
      <description>&lt;PRE&gt;token.Indexx&lt;/PRE&gt;&lt;P&gt;is already returning the value of the Indexx label. &lt;/P&gt;&lt;P&gt;You can just use the name of the label to get and set the label's value:&lt;/P&gt;&lt;PRE&gt;int value = token.Indexx;
token.Indexx = 5;&lt;/PRE&gt;&lt;P&gt;You only use the .value property on treenodes. You can access the treenode of a label using the labels property:&lt;/P&gt;&lt;PRE&gt;int value = token.labels["Indexx"].value;
token.labels["Indexx"].value = 5;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 May 2018 20:52:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-label-values-to-reference-global-table-rows-in-a/m-p/13519676#M30855</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2018-05-17T20:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to use label values to reference global table rows in a subflow?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-label-values-to-reference-global-table-rows-in-a/m-p/13519677#M30856</link>
      <description>&lt;P&gt;Thank you both!! It worked&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 21:13:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/how-to-use-label-values-to-reference-global-table-rows-in-a/m-p/13519677#M30856</guid>
      <dc:creator>pinakin_k</dc:creator>
      <dc:date>2018-05-17T21:13:43Z</dc:date>
    </item>
  </channel>
</rss>

