<?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: Is there a way to &amp;quot;send&amp;quot; variables between different Application Builder script namespaces? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Is-there-a-way-to-quot-send-quot-variables-between-different/m-p/476058#M72060</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/38359"&gt;@EstelleS&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Within any application script (Application-level or Module-level) you can access the Application Namespace with:&lt;/P&gt;
&lt;PRE&gt;appNS = thisApplication&amp;lt;&amp;lt;Get Namespace;
&lt;/PRE&gt;
&lt;P&gt;With that, you should be able to explicitly set/get variable values at the Application scope.&lt;/P&gt;
&lt;P&gt;Unscoped variables within a module script will only be visible within the given module by default.&amp;nbsp; If you need to have one module access the variables within another module, then the first module would need to have a reference to the second.&amp;nbsp; For example, you might have module1 create an instance of module2 with:&lt;/P&gt;
&lt;PRE&gt;	module2 &amp;lt;&amp;lt; CreateInstance(thisModuleInstance);
&lt;/PRE&gt;
&lt;P&gt;Variables 'thisApplication' and 'thisModuleInstance' are automatic variables that refer to the Application and (current) Module Instance.&amp;nbsp; Now, the module2 instance can access variables in the module1 instance by accessing the namespace for the module that was passed in:&lt;/P&gt;
&lt;PRE&gt;OnModuleLoad({callingModule},
	ns = callingModule &amp;lt;&amp;lt; Get Namespace;
);
&lt;/PRE&gt;
&lt;P&gt;I hope that helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Dan&lt;/P&gt;</description>
    <pubDate>Mon, 04 Apr 2022 18:51:08 GMT</pubDate>
    <dc:creator>danschikore</dc:creator>
    <dc:date>2022-04-04T18:51:08Z</dc:date>
    <item>
      <title>Is there a way to "send" variables between different Application Builder script namespaces?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-a-way-to-quot-send-quot-variables-between-different/m-p/475974#M72050</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working with Application Builder and I have lots of module windows and scripting required. I'm wondering if there is a way to "send" or "push"/"pull" variables to and from different scripting namespaces.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, I have been defining most variables on the Application namespace, but it is starting to get very busy and I would prefer to have the scripts under their relevant modules where the variables are referenced on the Application namespace as needed. One solution would be defining global variables,&amp;nbsp;but I am worried about potential future problems with variable naming. Is there a way to get around this? Alternatively, is there a way to configure "Names Default to Here" or something similar so the variables I define will default to the Application namespace and can be referenced by all module scripts?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate any insights!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:55:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-a-way-to-quot-send-quot-variables-between-different/m-p/475974#M72050</guid>
      <dc:creator>EstelleS</dc:creator>
      <dc:date>2023-06-09T16:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to "send" variables between different Application Builder script namespaces?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-a-way-to-quot-send-quot-variables-between-different/m-p/476058#M72060</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/38359"&gt;@EstelleS&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Within any application script (Application-level or Module-level) you can access the Application Namespace with:&lt;/P&gt;
&lt;PRE&gt;appNS = thisApplication&amp;lt;&amp;lt;Get Namespace;
&lt;/PRE&gt;
&lt;P&gt;With that, you should be able to explicitly set/get variable values at the Application scope.&lt;/P&gt;
&lt;P&gt;Unscoped variables within a module script will only be visible within the given module by default.&amp;nbsp; If you need to have one module access the variables within another module, then the first module would need to have a reference to the second.&amp;nbsp; For example, you might have module1 create an instance of module2 with:&lt;/P&gt;
&lt;PRE&gt;	module2 &amp;lt;&amp;lt; CreateInstance(thisModuleInstance);
&lt;/PRE&gt;
&lt;P&gt;Variables 'thisApplication' and 'thisModuleInstance' are automatic variables that refer to the Application and (current) Module Instance.&amp;nbsp; Now, the module2 instance can access variables in the module1 instance by accessing the namespace for the module that was passed in:&lt;/P&gt;
&lt;PRE&gt;OnModuleLoad({callingModule},
	ns = callingModule &amp;lt;&amp;lt; Get Namespace;
);
&lt;/PRE&gt;
&lt;P&gt;I hope that helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Dan&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 18:51:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-a-way-to-quot-send-quot-variables-between-different/m-p/476058#M72060</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2022-04-04T18:51:08Z</dc:date>
    </item>
  </channel>
</rss>

