BookmarkSubscribe
Choose Language Hide Translation Bar
nikles
Community Trekker

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?

 

0 Kudos
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
4 REPLIES 4
txnelson
Super User

Re: How do I close a report window?

pp << close window ;
Jim
0 Kudos
nikles
Community Trekker

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.

0 Kudos
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
Community Trekker

Re: How do I close a report window?

Thanks Tex.  That works.

0 Kudos