<?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: What is the best way to pass parameters in the onMessage trigger to a user command? in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/what-is-the-best-way-to-pass-parameters-in-the-onmessage-trigger/m-p/13524390#M34603</link>
    <description>&lt;P&gt;
	Just pass the return values from the functions directly. In your OnMessage, do this:&lt;/P&gt;
&lt;PRE&gt;return myOnMessageUserCommand(current, msgsendingobject, msgparam(1), msgparam(2), msgparam(3));&lt;/PRE&gt;</description>
    <pubDate>Thu, 22 Sep 2016 16:51:44 GMT</pubDate>
    <dc:creator>philboboADSK</dc:creator>
    <dc:date>2016-09-22T16:51:44Z</dc:date>
    <item>
      <title>What is the best way to pass parameters in the onMessage trigger to a user command?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/what-is-the-best-way-to-pass-parameters-in-the-onmessage-trigger/m-p/13524388#M34601</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 16.2.0 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We generally have the onMessage triggers of our objects call a onMessage... user command so that we can manage the code for multiple objects in the same user command instead of editing each object's message trigger separately. Currently we are parsing the 3 parameters that you get by calling msgparam(1), etc. into doubles which we then pass on to the user command.&lt;/P&gt;&lt;P&gt;Now when FlexSim supports variants, is using doubles still the way to do it or should one parse the message parameters as variants and pass them on as variants instead when passing them to a user command? &lt;/P&gt;&lt;P&gt;The code below seems to work and so does also using variants with TASKTYPE_SENDMESSAGE.&lt;/P&gt;&lt;PRE&gt;var test = 5;
senddelayedmessage(current, 0, current, test);&lt;/PRE&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Axel&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 05:20:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/what-is-the-best-way-to-pass-parameters-in-the-onmessage-trigger/m-p/13524388#M34601</guid>
      <dc:creator>axel_kohonen</dc:creator>
      <dc:date>2016-09-22T05:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to pass parameters in the onMessage trigger to a user command?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/what-is-the-best-way-to-pass-parameters-in-the-onmessage-trigger/m-p/13524389#M34602</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/206/phil.b.html" nodeid="206"&gt;@phil.bobo&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 16:39:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/what-is-the-best-way-to-pass-parameters-in-the-onmessage-trigger/m-p/13524389#M34602</guid>
      <dc:creator>jeff_nordgren</dc:creator>
      <dc:date>2016-09-22T16:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to pass parameters in the onMessage trigger to a user command?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/what-is-the-best-way-to-pass-parameters-in-the-onmessage-trigger/m-p/13524390#M34603</link>
      <description>&lt;P&gt;
	Just pass the return values from the functions directly. In your OnMessage, do this:&lt;/P&gt;
&lt;PRE&gt;return myOnMessageUserCommand(current, msgsendingobject, msgparam(1), msgparam(2), msgparam(3));&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Sep 2016 16:51:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/what-is-the-best-way-to-pass-parameters-in-the-onmessage-trigger/m-p/13524390#M34603</guid>
      <dc:creator>philboboADSK</dc:creator>
      <dc:date>2016-09-22T16:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: What is the best way to pass parameters in the onMessage trigger to a user command?</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/what-is-the-best-way-to-pass-parameters-in-the-onmessage-trigger/m-p/13524391#M34604</link>
      <description>&lt;P&gt;Hi Phil,&lt;/P&gt;&lt;P&gt;Great! Thank you!&lt;/P&gt;&lt;P&gt;Axel&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2016 04:25:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/what-is-the-best-way-to-pass-parameters-in-the-onmessage-trigger/m-p/13524391#M34604</guid>
      <dc:creator>axel_kohonen</dc:creator>
      <dc:date>2016-09-23T04:25:47Z</dc:date>
    </item>
  </channel>
</rss>

