Subscribe Bookmark RSS Feed

Delay script execution until recode is done ?

ching1007

New Contributor

Joined:

Mar 15, 2017

Here's my script:

Open( "Filename1" );

Current Data Table() << Go To( :Value ) << Recode;

New Window( "Report",

Current Data Table() << Bivarate( Y( :Value ), X( :Name )

);

 

When I run my script, both Recode Window and Report Window with plot will pop out. Is there any where to let me do the recode first before Report Window is generated?

Thanks in advance for any advice.

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales

Staff

Joined:

Mar 21, 2013

Solution

You can attach the second half of your script to the onClose event in the recode window like this. I changed your CurrentDataTable to use an explicit data table reference, but I don't see a way to get an explicit reference to the recode window, other than using the window function. So, make sure there is only one recode window open.

dt = Open( "$sample_data/big class.jmp" );
dt << Go To( :sex ) << Recode;

Window( "Recode" ) << onclose(
    New Window( "Report", dt << Contingency( Y( :age ), X( :sex ), Contingency Table ) );
);

 

Craige
2 REPLIES
Craige_Hales

Staff

Joined:

Mar 21, 2013

Solution

You can attach the second half of your script to the onClose event in the recode window like this. I changed your CurrentDataTable to use an explicit data table reference, but I don't see a way to get an explicit reference to the recode window, other than using the window function. So, make sure there is only one recode window open.

dt = Open( "$sample_data/big class.jmp" );
dt << Go To( :sex ) << Recode;

Window( "Recode" ) << onclose(
    New Window( "Report", dt << Contingency( Y( :age ), X( :sex ), Contingency Table ) );
);

 

Craige
ching1007

New Contributor

Joined:

Mar 15, 2017

Hello Craige,

 

Thank you so much !