Report Window Doesn't CloseI have a script that I am trying to set up that when run, it pops up an interactive GUI that looks like this:

I can populate the lot number and the only button that works at the moment is the "CPL Screen" one. I click it and it produces a report of whether the wafers in that lot passed screening limits. If there are error codes or super high values within the data a button box is added to the report asking if the user wants to have those values removed and the screening done again.

I have set up the button to where it is supposed to close the current report window and data table associated with it and rerun the same "CPL Screen" as done in the beginning after removing the bad data. The only problem is that when I click the rerun button the original window doesn close and the report doesn't finish.
I can physically go into the script and highlight the code that is connected to the button and the script runs fine. It only doens't work if I actually click the button. Here is what the Window list looks like the when it is the first time through:

Here is what it looks like when i click the rerun button:

It seems that the original report doesn't close prior to the new one opening. I am stumped considering I can phyically run the same code and everything works. The following is a suedo flow chart of what the script is doing:

Any help would be much appreciated
Re: Report Window Doesn't CloseThe button and all of its properties, including its script, is a child of a display tree. The display tree is contained in the window. When you close the window, the button and its script are destroyed. This would cause an error – potentially a very serious one – if it's the button script that closed the window. So, JMP watches for that and makes sure that the window is hiddent but hangs around for the button script to finish.
Here's a script to demonstrate this behavior. Watch the window list in your Home Window to see it:
win1 = New Window( "Window 1",
V List Box(
Button Box( "Close window 1 and open window 2",
win1 << close window;
win2 = New Window( "Window 2",
<<MODAL></MODAL>
Re: Report Window Doesn't CloseI figured out that if you put a button in the report window that closes that window and continues with more script, the window that contained the button doesn't fully close. But if you place a button outside the report window that does the exact same script, then everything works fine. I am not exactly sure why that is and I had to change my script a little to compensate, but it now works fine in the end.Re: Report Window Doesn't CloseThe code to add the button to the report window is thus:
if(errors_exist == 1 | large_value == 1,
error_box << append(Button box("Remove Erroneous Data and Rerun Analysis",redo_analysis))
)
The code for redo_analysis is as follows:
redo_analysis = expr(//if the user wants to eliminate error codes or large data values need to redo the screening and remove the issue points
close(dt_screen_results, nosave);
re_run = 1; //boolean flip to not have the script pull data from the database again
screen_result_window << close window;
//wait(5);
column(dt_lot, "Screen Results") << set selected(1);
dt_lot << delete columns();
if(errors_exist == 1, //deletes the error code rows
dt_lot << selectrows(error_rows)
);
if(large_value == 1,//deletes the large value rows
dt_lot << selectrows(large_values)
);
dt_lot << delete rows()
CPL_screen
//window(char(lot_num << get text) || " CPL Results Summary") << close window;
);
If I push the button in the report the issue persists. If i don't push the button but highlight redo_analysis in the script and run that portion everything works fine.
Re: Report Window Doesn't ClosePopping open a window in JMP does not automatically stop the processing of your script. One either has to declare the window to be a "Modal" window or embed the code to be run into the objects within the window, so they are not run until a user clicks on a button, or makes a choice in a combo box, etc.
So my guess, is that your JMP code continues processing while you have your window open, and you are thinking the processing is waiting your the user input prior to continuing.
Re: Report Window Doesn't CloseAfter more fiddling, it appears that the script isn't running in the sequence I had thought it should. I thought the script would execute things sequentially, as in line 10 would be executed then move on to line 11 and execute that. I found that even though I have the line of report << close window() on a line at the beginning of the rerun portion, the script doesn't fully execute that line until the script is fully finished. The window will become hidden but not fully closed until the new window is opened. Since I have a <Any ideas as to why JMP is doing this and what I can do to mitigate it? I forgot to mention that I am running JMP 12.