<?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 access Here namespace during entered Local Here namespace? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-access-Here-namespace-during-entered-Local-Here-namespace/m-p/803172#M97998</link>
    <description>&lt;P&gt;Hi jthi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that the case, could you advise what is the best approach for "root namespace"? I'm using Global namespace right now and intent to leverage to Here namespace and avoid namespace pollute. My script is involved ~80 variables.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Oct 2024 08:08:20 GMT</pubDate>
    <dc:creator>nthai</dc:creator>
    <dc:date>2024-10-02T08:08:20Z</dc:date>
    <item>
      <title>How to access Here namespace during entered Local Here namespace?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-access-Here-namespace-during-entered-Local-Here-namespace/m-p/803159#M97996</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm having trouble to access the Here namespace during entered Local Here namespace. My example script as follow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
Delete Symbols();
// Declare a variable in the "Here" scope
x = "Variable";
Local Here(
    // Access the "Here" scope variable
    y = Eval(Namespace("here") &amp;lt;&amp;lt; Get("x"));
    Show(y);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I used debugger, can clearly see after entered Local Here, it has 2 Here scopes. My guess is one from Here, and the other from Local Here. I have tried several approaches, but none works so far.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 07:07:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-access-Here-namespace-during-entered-Local-Here-namespace/m-p/803159#M97996</guid>
      <dc:creator>nthai</dc:creator>
      <dc:date>2024-10-02T07:07:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Here namespace during entered Local Here namespace?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-access-Here-namespace-during-entered-Local-Here-namespace/m-p/803171#M97997</link>
      <description>&lt;P&gt;I think you can't directly (that is kinda the purpose of Local Here)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1727855324539.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/68773iEF92132B969CBB5C/image-size/large?v=v2&amp;amp;px=999" role="button" title="jthi_1-1727855324539.png" alt="jthi_1-1727855324539.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/18.1/#page/jmp/programming-functions.shtml?os=win&amp;amp;source=application#ww5016664" target="_blank"&gt;Programming Functions (jmp.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 07:48:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-access-Here-namespace-during-entered-Local-Here-namespace/m-p/803171#M97997</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-10-02T07:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Here namespace during entered Local Here namespace?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-access-Here-namespace-during-entered-Local-Here-namespace/m-p/803172#M97998</link>
      <description>&lt;P&gt;Hi jthi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that the case, could you advise what is the best approach for "root namespace"? I'm using Global namespace right now and intent to leverage to Here namespace and avoid namespace pollute. My script is involved ~80 variables.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 08:08:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-access-Here-namespace-during-entered-Local-Here-namespace/m-p/803172#M97998</guid>
      <dc:creator>nthai</dc:creator>
      <dc:date>2024-10-02T08:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Here namespace during entered Local Here namespace?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-access-Here-namespace-during-entered-Local-Here-namespace/m-p/803174#M97999</link>
      <description>&lt;P&gt;Depends on what you are doing. You can utilize named namespaces, anonymous namespaces, global, here, local,... but still, I&amp;nbsp;would almost always start my scripts with Names Default To Here(1);&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 09:03:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-access-Here-namespace-during-entered-Local-Here-namespace/m-p/803174#M97999</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-10-02T09:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Here namespace during entered Local Here namespace?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-access-Here-namespace-during-entered-Local-Here-namespace/m-p/803175#M98000</link>
      <description>&lt;P&gt;Without the&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Names Default to HERE(1)&lt;/FONT&gt;&amp;nbsp; the generated variables will "pollute" the Global Namespace.&lt;/P&gt;&lt;P&gt;With the&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Names Default to HERE(1)&amp;nbsp;&lt;/FONT&gt; the generated variables will "pollute" the &lt;FONT face="courier new,courier"&gt;Here&lt;/FONT&gt; Namespace.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To organize the variables, you can create your own namespace and create the variables there:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
Delete Symbols();
// Declare a variable in the "Here" scope
x = "Variable";

//get the value
ns = Namespace("here");
val = ns &amp;lt;&amp;lt; Get Value("x");
Print(val);
Show(x);


new namespace("myNS");
NS:x = "variable";
Show(NS:x)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Oct 2024 09:43:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-access-Here-namespace-during-entered-Local-Here-namespace/m-p/803175#M98000</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-10-02T09:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Here namespace during entered Local Here namespace?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-access-Here-namespace-during-entered-Local-Here-namespace/m-p/803178#M98001</link>
      <description>&lt;P&gt;It's strange that there are two &lt;FONT face="courier new,courier"&gt;HERE&lt;/FONT&gt; namespaces and that they show the same content - the one of the local here.&lt;BR /&gt;When you step out of the local here, there is just a single &lt;FONT face="courier new,courier"&gt;Here&lt;/FONT&gt; namespace and it correctly shows the content of the &lt;FONT face="courier new,courier"&gt;Names Default to Here(1)&lt;/FONT&gt; one.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Another issue with JSL debugger:&lt;BR /&gt;since JMP15 the local namespace of functions is not accessible anymore:&amp;nbsp;&lt;LI-MESSAGE title="Function locals in JSL Debugger" uid="680719" url="https://community.jmp.com/t5/Discussions/Function-locals-in-JSL-Debugger/m-p/680719#U680719" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6362750064112w582h540r846" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6362750064112" data-account="6058004218001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6058004218001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6362750064112w582h540r846');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://community.jmp.com/t5/video/gallerypage/video-id/6362750064112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Dec 2024 15:32:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-access-Here-namespace-during-entered-Local-Here-namespace/m-p/803178#M98001</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-29T15:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Here namespace during entered Local Here namespace?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-access-Here-namespace-during-entered-Local-Here-namespace/m-p/803331#M98018</link>
      <description>I have checked. Seems Local Here can access Global and named namespace just fine. However, how i am suppose to initial an anonymous namespace?&lt;BR /&gt;&lt;BR /&gt;Basically my idea is end-user doesn't need to care about the variables, and those variables/namespace will be closed after the data table associates with was closed.</description>
      <pubDate>Wed, 02 Oct 2024 23:24:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-access-Here-namespace-during-entered-Local-Here-namespace/m-p/803331#M98018</guid>
      <dc:creator>nthai</dc:creator>
      <dc:date>2024-10-02T23:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to access Here namespace during entered Local Here namespace?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-access-Here-namespace-during-entered-Local-Here-namespace/m-p/803733#M98092</link>
      <description>&lt;P&gt;For this purpose, use the &lt;FONT face="courier new,courier"&gt;Here&lt;/FONT&gt; namespace. It lives as long as the scripting window is open&amp;nbsp; - or some created window.&lt;BR /&gt;It will be deleted once the script window and the reports are closed.&lt;BR /&gt;&lt;BR /&gt;How to access it?&lt;BR /&gt;You can access any namespace if you have the "key":&lt;BR /&gt;At a moment with access to the namespace, just create a reference to the namespace and use it as the key.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Important:&amp;nbsp;&lt;BR /&gt;If you store the key in the &lt;FONT face="courier new,courier"&gt;Here&lt;/FONT&gt; namespace, it's not accessible from outside.&lt;/P&gt;&lt;P&gt;To make it accessible from everywhere, just store it in the global namespace.&lt;BR /&gt;-&amp;gt; global "polluted" by one key variable - not by ~ 80 variables anymore : )&lt;BR /&gt;&lt;BR /&gt;JMP will handle the anonymous "here" namespace and delete it once it's not needed anymore.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
Delete Symbols();
// Declare a variable in the outer "Here" scope
x = "Variable";
//myHere = Namespace("here"); // created inside HERE -&amp;gt;  not accessible from local here
::myHere= Namespace("here"); // so let's create the reference in the global NS
z=5;
Local Here(
	:: mylocalHere= Namespace("here"); // will be deleted after local HERE
    // the  same for "myHere": it will be deleted once the code is finished AND the editor is closed -&amp;gt; very convenient

	::mypersistentNamespace = New Namespace("persistent"); // manually created -&amp;gt; persistent
	persistent:y="still alive";

    // Access the outer "Here" scope variable via the namespace reference
    y = Eval(::myHere &amp;lt;&amp;lt; Get value ("z"));
    Show(y);
);

Show(:: mylocalHere); // deleted
Show(::mypersistentNamespace) // alive&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;from another scripting window:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Show(:: myHere);
Show(:: mylocalHere);
Show(::mypersistentNamespace);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 29 Dec 2024 15:39:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-access-Here-namespace-during-entered-Local-Here-namespace/m-p/803733#M98092</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-29T15:39:54Z</dc:date>
    </item>
  </channel>
</rss>

