<?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: Transferring/ updating variable values between modules. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Transferring-updating-variable-values-between-modules/m-p/655385#M84452</link>
    <description>&lt;P&gt;Are you creating a new window or a new application module for your dialog? They do not work the same way. See how to &lt;A href="https://www.jmp.com/support/help/en/17.0/#page/jmp/create-an-application.shtml" target="_self"&gt;pass variables with application modules&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jul 2023 12:35:44 GMT</pubDate>
    <dc:creator>Mark_Bailey</dc:creator>
    <dc:date>2023-07-05T12:35:44Z</dc:date>
    <item>
      <title>Transferring/ updating variable values between modules.</title>
      <link>https://community.jmp.com/t5/Discussions/Transferring-updating-variable-values-between-modules/m-p/654948#M84409</link>
      <description>&lt;P&gt;Hello, I am scripting in JMP Pro Application Builder.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I have a main window in which I have a button that brings me to a secondary window. Within the secondary window, there are text edit boxes where values are input by the user. Also, there is a close button on this secondary window that saves the values to the appNS and closes the secondary window.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I have the variables initialized in the main window to have default values of 0. I am having trouble getting the variables to use the updated values from the new window instead of the default values. It prints the default values instantly instead of running the function and then printing the updated values. Any help would be appreciated.&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Here are some code snippets for reference (PredictiveModeling is the main window and OptimizeModelWindow is the secondary window):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;appNS: ParamList1 = 0;
appNS: ParamList2 = 0;
appNS: ParamList3 = 0;
appNS: ParamList4 = 0;
appNS: ParamList5 = 0;
appNS: ParamList6 = 0;&lt;/CODE&gt;&lt;/PRE&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;OptimizeParamsButtonPress = Function( {this}, // This function is called when the OptimizeParams button is pressed on the PredictiveModeling Window
name = this &amp;lt;&amp;lt; Get Button Name;
OptimizeModelWindow &amp;lt;&amp;lt; Create Instance(thisModuleInstance);
Wait(OptimizeModelWindow);
PList1 = appNS: ParamList1;
PList2 = appNS: ParamList2;
PList3 = appNS: ParamList3;
PList4 = appNS: ParamList4;
PList5 = appNS: ParamList5;
PList6 = appNS: ParamList6;
Print(PList1,PList2,PList3,PList4,PList5,PList6);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This is where the variables are read from the EditBoxes and update the default values...&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;doOptimizeParams = Function ( {},
HP1 = PEdit1 &amp;lt;&amp;lt; Get Text;
appNS: ParamList1 = HP1;
HP2 = PEdit2 &amp;lt;&amp;lt; Get Text;
appNS: ParamList2 = HP2;
HP3 = PEdit3 &amp;lt;&amp;lt; Get Text;
appNS: ParamList3 = HP3;
HP4 = PEdit4 &amp;lt;&amp;lt; Get Text;
appNS: ParamList4 = HP4;
HP5 = PEdit5 &amp;lt;&amp;lt; Get Text;
appNS: ParamList5 = HP5;
HP6 = PEdit6 &amp;lt;&amp;lt; Get Text;
appNS: ParamList6 = HP6;
);

CloseOptimizeButtonPress = Function( {this},
// This function is called when the Optimize button is pressed on the popup OptimizeModel window&amp;nbsp;
name = this &amp;lt;&amp;lt; Get Button Name;
doOptimizeParams();
Print(ParamList1,ParamList2,ParamList3,ParamList4,ParamList5,ParamList6);
(thisModuleInstance &amp;lt;&amp;lt; GetBox) &amp;lt;&amp;lt; Close Window;
);&lt;/CODE&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Jul 2023 20:40:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Transferring-updating-variable-values-between-modules/m-p/654948#M84409</guid>
      <dc:creator>kterri3</dc:creator>
      <dc:date>2023-07-03T20:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Transferring/ updating variable values between modules.</title>
      <link>https://community.jmp.com/t5/Discussions/Transferring-updating-variable-values-between-modules/m-p/655385#M84452</link>
      <description>&lt;P&gt;Are you creating a new window or a new application module for your dialog? They do not work the same way. See how to &lt;A href="https://www.jmp.com/support/help/en/17.0/#page/jmp/create-an-application.shtml" target="_self"&gt;pass variables with application modules&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2023 12:35:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Transferring-updating-variable-values-between-modules/m-p/655385#M84452</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2023-07-05T12:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Transferring/ updating variable values between modules.</title>
      <link>https://community.jmp.com/t5/Discussions/Transferring-updating-variable-values-between-modules/m-p/657388#M84655</link>
      <description>&lt;P&gt;Thanks, I will look into that. I have two application modules for dialog, the primary module and the secondary module where the user inputs values. I have it working now, but maybe not the best way. I have a flag variable on the "close" button of the secondary module. When that flag is raised, I have a large "If" statement in my primary module that executes the code for this case.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 15:22:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Transferring-updating-variable-values-between-modules/m-p/657388#M84655</guid>
      <dc:creator>kterri3</dc:creator>
      <dc:date>2023-07-11T15:22:15Z</dc:date>
    </item>
  </channel>
</rss>

