cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • DownloadSemiconductor Toolkit: Tools to create wafer maps, add wafer geometry to graphics, explore die defects & compare wafers.
  • Discovery Summit 2026: Early User Edition - September 23-24.Register. It's free.
  • See how to access JMP Marketplace - and - find, create & share add-ins to extend your JMP. Watch video.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
janeg
Level II

How to tell a window has not been closed?

Can someone tell me if there is an easier way to tell if a window is still open?  I have a case where a task is being done.  Once it is done, the window is closed.  However, the user can close the window before then. 

I can't find the jsl command that equals   Is Valid 

J

window_ptr = New Window( "hi", Text Box( "abcd" ) );

window_title = (window_ptr << Get Window Title());

Wait( 5 );

windows = Window();

window_open = 1;

For( i = 1, i <= N Items( windows ), i++,

   tmp_title = (windows << get window title);

   If( window_title == tmp_title,

      window_open = 0

   );

);

If( window_open == 1,

   Print( " window is closed." ),

   Print( " window is open." )

);

1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User (Alumni) ms
Super User (Alumni)

Re: How to tell a window has not been closed?

Here is one way to avoid the loop:

if(window(window_title)=={},  Print( " window is closed." ),

   Print( " window is open." ));

View solution in original post

3 REPLIES 3
ms
Super User (Alumni) ms
Super User (Alumni)

Re: How to tell a window has not been closed?

Here is one way to avoid the loop:

if(window(window_title)=={},  Print( " window is closed." ),

   Print( " window is open." ));

janeg
Level II

Re: How to tell a window has not been closed?

Awesome!  That does exactly what I wanted.  Thank you!

pmroz
Super User

Re: How to tell a window has not been closed?

I just found another way to do the same thing.  Use is empty() on the window variable.  If it's true, then the window is not open.  If it's false, then it is open.

window_ptr = New Window( "hi", Text Box( "abcd" ) );

Wait( 5 );

window_open = !Is Empty( window_ptr );

If( window_open,

    Print( " window is open." ),

    Print( " window is closed." )

);

Recommended Articles