<?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: Why does my integer variable not set from label? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/why-does-my-integer-variable-not-set-from-label/m-p/13563745#M65733</link>
    <description>&lt;P&gt;You could also change the datatype of the table cell (or column) to be number data (through the right click menu). Then you wouldn't have to convert the string into a number later.&lt;/P&gt;</description>
    <pubDate>Fri, 19 Oct 2018 15:39:06 GMT</pubDate>
    <dc:creator>Matthew_Gillespie</dc:creator>
    <dc:date>2018-10-19T15:39:06Z</dc:date>
    <item>
      <title>Why does my integer variable not set from label?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/why-does-my-integer-variable-not-set-from-label/m-p/13563739#M65727</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 18.2.2 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;I'm trying to process some tokens by case with a switch command that requires an integer.&lt;/P&gt;
&lt;P&gt;I have some custom code that looks up a WType string in a table and assigns an WTypeVal label to the tokens. I want to use WTypeVal in the switch command. However, I seem to only get 0 assigned to the integer variable Wtype. I've tried a dozen variations with the same result. I've posted a pic of the model. It is difficult to post the whole model as there is client proprietary info in it.&lt;/P&gt;
&lt;P&gt;As you can see the custom code is in a subprocess. The token in question has WTypeVal of 3. I only get Wtype of 0. I assigned 15 to Wtype just to prove it changes to 0.&lt;/P&gt;
&lt;P&gt;It seems that Parent, Child relationship is a bit fuzzy going to a subprocess with custom code because many of the Label names do not show up in the pick list when entering code.&lt;/P&gt;
&lt;P&gt;Any help is appreciated.&lt;/P&gt;
&lt;P&gt;&lt;A id="15089" href="https://answers.flexsim.com/storage/attachments/15089-wtype-not-set.jpg"&gt;wtype-not-set.jpg&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Scott&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 23:37:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/why-does-my-integer-variable-not-set-from-label/m-p/13563739#M65727</guid>
      <dc:creator>scott_ainsworth</dc:creator>
      <dc:date>2018-10-18T23:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my integer variable not set from label?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/why-does-my-integer-variable-not-set-from-label/m-p/13563740#M65728</link>
      <description>&lt;P&gt;Depending on what parent label access you gave the child token it's possible that token.parent.WTypeVal is different than token.WTypeVal.&lt;/P&gt;&lt;P&gt;Can you attach the model?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 00:06:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/why-does-my-integer-variable-not-set-from-label/m-p/13563740#M65728</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2018-10-19T00:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my integer variable not set from label?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/why-does-my-integer-variable-not-set-from-label/m-p/13563741#M65729</link>
      <description>&lt;P&gt;Parent Label Access is set to Read Write in the Run Sub Flow block. I've tried "Label Access on Parent Only" and "Copy Labels to Children on Create". I've also tried assigning a label WTypeVal with token.WTypeVal as the value. It still returns a 0 in the sub process code shown. I'm baffled.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 00:41:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/why-does-my-integer-variable-not-set-from-label/m-p/13563741#M65729</guid>
      <dc:creator>scott_ainsworth</dc:creator>
      <dc:date>2018-10-19T00:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my integer variable not set from label?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/why-does-my-integer-variable-not-set-from-label/m-p/13563742#M65730</link>
      <description>&lt;P&gt;I ran this bit of code prior to the sub flow call. It must be something to do with how the label is created. As you can see bill and bob are both assigned the same way in the code. bob is gets 0 and bill gets 3. Both labels have a value of 3 in the token.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="15096-wtypeval-test.jpg"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1497955iE219505FD16F88B0/image-size/large?v=v2&amp;amp;px=999" role="button" title="15096-wtypeval-test.jpg" alt="15096-wtypeval-test.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The WTypeVal is set with the attached code, where as the SashFactor is set with an assign labels command. &lt;A id="15097" href="https://answers.flexsim.com/storage/temp/15097-wtypeval-assignment.txt"&gt;wtypeval-assignment.txt&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I'm not sure what I've done wrong.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 01:29:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/why-does-my-integer-variable-not-set-from-label/m-p/13563742#M65730</guid>
      <dc:creator>scott_ainsworth</dc:creator>
      <dc:date>2018-10-19T01:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my integer variable not set from label?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/why-does-my-integer-variable-not-set-from-label/m-p/13563743#M65731</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/1061/scott.a.html" nodeid="1061"&gt;@Scott Ainsworth&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Since you are saying like "I have some custom code that looks up a WType &lt;STRONG&gt;string&lt;/STRONG&gt; in a table and assigns a WTypeVal label to the tokens." &lt;/P&gt;&lt;P&gt;Make sure that you are getting the number type as a value in the label. If you are getting a label value as string type then you have to convert that into number type using toNum() or stringtonum() command. &lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 05:44:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/why-does-my-integer-variable-not-set-from-label/m-p/13563743#M65731</guid>
      <dc:creator>raja_sekaran</dc:creator>
      <dc:date>2018-10-19T05:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my integer variable not set from label?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/why-does-my-integer-variable-not-set-from-label/m-p/13563744#M65732</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/885/raja.s.html" nodeid="885"&gt;@Raja Sekaran&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You are correct. I added stringtonum() in the command that assigns the label and now the value is read properly.&lt;/P&gt;
&lt;P&gt;Thank You&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="15110-wtypeval-assign.jpg"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1497959i7867344D1C81585E/image-size/large?v=v2&amp;amp;px=999" role="button" title="15110-wtypeval-assign.jpg" alt="15110-wtypeval-assign.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 13:41:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/why-does-my-integer-variable-not-set-from-label/m-p/13563744#M65732</guid>
      <dc:creator>scott_ainsworth</dc:creator>
      <dc:date>2018-10-19T13:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my integer variable not set from label?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/why-does-my-integer-variable-not-set-from-label/m-p/13563745#M65733</link>
      <description>&lt;P&gt;You could also change the datatype of the table cell (or column) to be number data (through the right click menu). Then you wouldn't have to convert the string into a number later.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2018 15:39:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/why-does-my-integer-variable-not-set-from-label/m-p/13563745#M65733</guid>
      <dc:creator>Matthew_Gillespie</dc:creator>
      <dc:date>2018-10-19T15:39:06Z</dc:date>
    </item>
  </channel>
</rss>

