cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
nikles
Level VI

How do I close a report window?

Is there a way to close a pareto plot window by referencing the window or report name?  I'm creating a script that generates a pareto plot.  Prior to generating the plot though, I want to close any prior instances of the plot.  To do this, I'm trying the following:

 

 

dt = Current Data Table();
tablename = dt << Get Name;
Try(Close(tablename || " - Pareto Plot", NoSave));   //Attempt to close report...does not work.
pp = Pareto Plot( Cause(dt:List of Failing Tests), Show **bleep** Percent Curve(0), //Ha. It autobleeped the abbreviation for "Cumulative". Category Legend(1), By(dt:Module) ); pp << Set Window Title(tablename||" - Pareto Plot");

Thoughts?

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How do I close a report window?

The Window() function will point to a specific window by the window number or the window name.  So, the following will work.

Window( "My Pareto Plot" ) << close window;

But in addition to that, you need to read about name spaces, global variables and local variables.  

In short, you can easily declare a Name Space, such as "MySpace", where you can create your window pointers to, and that name space will remain for the duration of your JMP session, unless the name space is specifically modified or deleted.  So you can do something like:

nsref = New Namespace( "Myspace" );

Myspace:thePareto = dt << Pareto Plot(……………………..);

Any script that you point to the namespace called "Myspace" will be referencing the same memory variables etc.

Jim

View solution in original post

8 REPLIES 8
txnelson
Super User

Re: How do I close a report window?

pp << close window ;
Jim
nikles
Level VI

Re: How do I close a report window?

Not quite.  I can't issue "pp << close window" since pp is undefined prior to creating the report window.  To clarify, the window I'm trying to close is from a prior run of the same script.  (It is my understanding that) once the script starts anew, the buffer is cleared of all variables from previous runs.

 

Is there possibly a command that returns a reference to a window based on its name, like Window("My Pareto Plot").  I checked but did not find.

txnelson
Super User

Re: How do I close a report window?

The Window() function will point to a specific window by the window number or the window name.  So, the following will work.

Window( "My Pareto Plot" ) << close window;

But in addition to that, you need to read about name spaces, global variables and local variables.  

In short, you can easily declare a Name Space, such as "MySpace", where you can create your window pointers to, and that name space will remain for the duration of your JMP session, unless the name space is specifically modified or deleted.  So you can do something like:

nsref = New Namespace( "Myspace" );

Myspace:thePareto = dt << Pareto Plot(……………………..);

Any script that you point to the namespace called "Myspace" will be referencing the same memory variables etc.

Jim
nikles
Level VI

Re: How do I close a report window?

Thanks Tex.  That works.

worldkeeping
Level II

Re: How do I close a report window?

Is there a way to script to close all windows opened through a user interface I created upon hit the cross button sitting on the top right of my interface window?

worldkeeping_0-1688666399440.png

 

txnelson
Super User

Re: How do I close a report window?

You can use the On Close() feature for a window, to run a script that can close windows.  If you want to close all windows, you can loop through all open windows and close them.  If you want to close only the windows that were opened by your application, then I suggest that you create a list in your application that keeps track of the windows that open, and then in the On Close() section, you loop through that list.

Jim

Re: How do I close a report window?

Lists generally distribute a message sent to them to all the items. You might simply have to send the << Close Window message to the list of window references.

worldkeeping
Level II

Re: How do I close a report window?

It works. Thank you sir!