<?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: Turning Private data tables on and off in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/530882#M75406</link>
    <description>&lt;P&gt;What precisely are the benefits of using private tables? Saving memory?&lt;/P&gt;</description>
    <pubDate>Fri, 05 Aug 2022 14:12:51 GMT</pubDate>
    <dc:creator>Ressel</dc:creator>
    <dc:date>2022-08-05T14:12:51Z</dc:date>
    <item>
      <title>Turning Private data tables on and off</title>
      <link>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/462267#M70705</link>
      <description>&lt;P&gt;In keeping many of my scripts clean, I use 'private' quite a lot. However, if I am troubleshooting a script, having tables as private gets in the way and I need to comment out and hopefully remember to uncomment as I make changes to see if the changes work.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Is there a way, or does JMP already have a global way to turn private tables on or off? In my head I could take the time to make duplicates of my code with and without the private and tie it to a test variable, but that doesn't seem like the best answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wasn't sure if there were any ideas out there on how to do that. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 18:11:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/462267#M70705</guid>
      <dc:creator>nathan-clark</dc:creator>
      <dc:date>2023-06-09T18:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Private data tables on and off</title>
      <link>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/462287#M70706</link>
      <description>&lt;P&gt;I am not aware of being able to turn Private on and off, since it would require on-the-fly building of all of the display objects in memory.&amp;nbsp; However, you can use the Show Window message to display/hide normal or invisible data tables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;data table("Daily Blood Pressure")&amp;lt;&amp;lt;show window(0);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 Feb 2022 21:29:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/462287#M70706</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-02-18T21:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Private data tables on and off</title>
      <link>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/462289#M70708</link>
      <description>&lt;P&gt;You might be able to make private table visible by using &amp;lt;&amp;lt; New Data View. I'm not 100% what this does in this context, but it seems to make private tables visible and I have used it for debugging:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp", private);
wait(2);
dt &amp;lt;&amp;lt; New Data View;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;no idea how to make it private again, but&amp;nbsp; &amp;lt;&amp;lt; Show Window(0); will make it invisible at least.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2022 22:00:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/462289#M70708</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-02-18T22:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Private data tables on and off</title>
      <link>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/462314#M70710</link>
      <description>&lt;P&gt;Visible and invisible tables are tracked by JMP. You can keep an eye on them in the home window, for example. Private tables are tracked only by the code that creates them. If you fail to close a private table before overwriting the JSL variable holding its handle, the table is still in memory but unreachable. It will be closed when JMP terminates. (Window-&amp;gt;CloseAllDataTables can't find the private tables and won't close them.)&lt;/P&gt;
&lt;P&gt;I'm also pretty sure JMP does not expose a way to turn a visible or invisible table private. You can turn a private table to an invisible one, if you have the handle, like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtA = Open( "$SAMPLE_DATA/Big Class.jmp", private );
// getting the data box makes it invisible
b = dtA &amp;lt;&amp;lt; New Data Box();
// then show window makes it visible
dtA &amp;lt;&amp;lt; Show Window;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Unfortunately, the invisible keyword &lt;EM&gt;is&lt;/EM&gt; a keyword and can't be passed as a variable, at least to open(). Not sure about subset, etc. Probably the best you can do is add a call to a user function that does something like above after each point where you create or open a table.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Feb 2022 22:12:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/462314#M70710</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-02-18T22:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Private data tables on and off</title>
      <link>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/472337#M71697</link>
      <description>&lt;P&gt;Thanks everyone! I ended up doing the following which, although not ideal, should work pretty well. I created a function and have a variable at the top of my script to basically turn private on / off&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;seePrivateTables = 1;

unprivatizeTable = Function({bool,tableName},{default local},
	If(bool == 1,
		tableName &amp;lt;&amp;lt; New Data View;
		Return(tableName)
		,
		Return(tableName)
	)
);

// ... various code

dt1 = dt &amp;lt;&amp;lt; Summary(.... , private);
dt1 = unprivatizeTable(seePrivateTables, dt1);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As long as I remember to call that function when I create new tables, I should be able to turn private tables on and off in bulk.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 15:01:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/472337#M71697</guid>
      <dc:creator>nathan-clark</dc:creator>
      <dc:date>2022-03-23T15:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Private data tables on and off</title>
      <link>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/472434#M71710</link>
      <description>&lt;P&gt;If you need that function often, you might benefit from creation of Custom function &lt;A href="https://www.jmp.com/support/help/en/16.2/#page/jmp/create-custom-functions-transforms-and-formats.shtml?os=win&amp;amp;source=application&amp;amp;utm_source=helpmenu&amp;amp;utm_medium=application#ww1472209" target="_blank" rel="noopener"&gt;Create Custom Functions, Transforms, and Formats (jmp.com)&lt;/A&gt; .This way you can also see the custom function directly from scripting index.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 18:17:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/472434#M71710</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-03-23T18:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Private data tables on and off</title>
      <link>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/472435#M71711</link>
      <description>&lt;P&gt;Yes! That's definitely on my radar. I have a library of functions/utilities I keep a lot of that stuff on hand (and distribute), and shifting to the custom function aspect is one plan long term for many of the more dynamic functions.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 18:21:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/472435#M71711</guid>
      <dc:creator>nathan-clark</dc:creator>
      <dc:date>2022-03-23T18:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Private data tables on and off</title>
      <link>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/530882#M75406</link>
      <description>&lt;P&gt;What precisely are the benefits of using private tables? Saving memory?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 14:12:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/530882#M75406</guid>
      <dc:creator>Ressel</dc:creator>
      <dc:date>2022-08-05T14:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Private data tables on and off</title>
      <link>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/530960#M75412</link>
      <description>&lt;P&gt;Saving RAM is the benefit.&amp;nbsp; A Private table does not create any visible objects.&amp;nbsp; All of those objects would have to be mapped to memory if they are visible.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 16:20:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/530960#M75412</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-08-05T16:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Private data tables on and off</title>
      <link>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/531020#M75416</link>
      <description>&lt;P&gt;Nathan, is this helpful at all?&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here( 1 );
dt = open("$SAMPLE_DATA\Big Class.jmp");
privateTable = Function({bool,dt},{default local},
	table_name = dt &amp;lt;&amp;lt; Get Name;
	If(!bool &amp;amp; !(dt &amp;lt;&amp;lt; HasDataView), // no table but you want one
		print("making "||table_name||" public");
		dt &amp;lt;&amp;lt; New Data View;
		Return(dt);
	, // elif
		bool &amp;amp; dt &amp;lt;&amp;lt; HasDataView, // you have a table but want it private
		print("making "||table_name||" private");
		dt_sub = dt &amp;lt;&amp;lt; Subset( All rows, Selected columns only( 0 ), "private" );
		close(dt, no save);
		dt_sub &amp;lt;&amp;lt; Set Name(table_name);
		return(dt_sub);
	, // else just return what's given
		print("passthrough");
		return(dt);
	)
);

dt = privateTable(1, dt); // should make it private
wait(2);
dt = privateTable(1, dt); // should do nothing
wait(2);
dt = privateTable(0, dt); // should do make it visible
wait(2);
dt = privateTable(1, dt); // should do make it private again
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Aug 2022 17:39:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/531020#M75416</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2022-08-05T17:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Private data tables on and off</title>
      <link>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/531088#M75426</link>
      <description>&lt;P&gt;Jim is correct; a private table has no OS window structure created, while an invisible table has a window that is not displayed. There might be a small CPU and memory savings which might add up if there are 100s or 1000s of tables.&lt;/P&gt;
&lt;P&gt;The only time I've used private was when I wrote &lt;LI-MESSAGE title="FileSnapper" uid="321870" url="https://community.jmp.com/t5/Uncharted/FileSnapper/m-p/321870#U321870" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp; and wanted the application to be quietly running without disturbing the JSL environment for any other JSL that runs. You mostly can't detect the private data table at all. It does have a column name that intrudes a little. &lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 22:43:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/531088#M75426</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-08-05T22:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Private data tables on and off</title>
      <link>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/531600#M75467</link>
      <description>&lt;P&gt;Agreed&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt; on&amp;nbsp;those points.&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/15435"&gt;@Ressel&lt;/a&gt;,&amp;nbsp;the main reason I usually opt for private tables is when I have a script that makes changes/updates/etc many tables. If they are left alone, they can be very flashy on the screen in front of a user as the windoes come up, go away, etc. If they are invisible the user may see a lot of activity in the Window list which also can be a distraction.&lt;BR /&gt;&lt;BR /&gt;I opt for private tables most of the time as they allow for the cleanest interface for the user with only the necessary visual steps being visual. Depending on the number of tables and the users computer, the RAM benefits are also a gain in overall speed.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 16:32:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/531600#M75467</guid>
      <dc:creator>nathan-clark</dc:creator>
      <dc:date>2022-08-08T16:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: Turning Private data tables on and off</title>
      <link>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/532052#M75509</link>
      <description>&lt;P&gt;That's excellent, Vince! It's similar to what I ended up doing, but it's much more elegant in allowing the dataview to go both ways.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 17:25:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Turning-Private-data-tables-on-and-off/m-p/532052#M75509</guid>
      <dc:creator>nathan-clark</dc:creator>
      <dc:date>2022-08-09T17:25:23Z</dc:date>
    </item>
  </channel>
</rss>

