ching1007
Community Trekker

Delay script execution until recode is done ?

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.

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Staff (Retired)

Re: Delay script execution until recode is done ?

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

View solution in original post

2 REPLIES 2
Craige_Hales
Staff (Retired)

Re: Delay script execution until recode is done ?

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

View solution in original post

ching1007
Community Trekker

Re: Delay script execution until recode is done ?

Hello Craige,

 

Thank you so much !