I think I understand what you're trying to do -- effectively you want the input window for the Survival()
platform to be Modal
-- you want it to block execution of the script until the window is closed. You can do that by explicitly defining a window instead of relying on the default behavior. Here I've created a modal window that contains the input fields, then I grab each input and create the Survival()
expression with the correct inputs.
Names Default To Here( 1 );
dt = Current Data Table();
If( Not( Is Scriptable( dt ) ),
dtsel = Pick File( "Open File", {"JMP|jmp", "All files|*"} );
If( dtsel == "",
Stop(),
Try( dt = Open( dtsel ), Stop() )
);
);
dtname = Data Table( dt ) << Get Name;
validated = 0;
New Window( "Inputs",
<<Modal
,
<<On Validate(
survival = {};
Insert Into( survival, Substitute( olb[List Box Box( 2 )] << Get Items, {}, Expr( Y() ) ) );
Insert Into( survival, Substitute( olb[List Box Box( 3 )] << Get Items, {}, Expr( Grouping() ) ) );
Insert Into( survival, Substitute( olb[List Box Box( 4 )] << Get Items, {}, Expr( Censor() ) ) );
Insert Into( survival, Substitute( olb[List Box Box( 5 )] << Get Items, {}, Expr( Freq() ) ) );
Insert Into( survival, Substitute( olb[List Box Box( 6 )] << Get Items, {}, Expr( By() ) ) );
Insert Into( survival, Insert( Expr( Censor Code() ), olb[Number Edit Box( 1 )] << Get ) );
Insert Into( survival, Insert( Expr( Plot failure instead of Survival() ), olb[Check Box Box( 1 )] << Get ) );
survival expr = Expr( Send( dt ) );
Insert Into( survival expr, Substitute( survival, {}, Expr( Survival() ) ) );
obj = survival expr;
obj << Save Estimates;
validated = 1;
)
,
olb = Outline Box( "",
dt << Survival(
Failure Plot( 1 ),
Show Points( 1 ),
Show Shaded Simultaneous CI( 1 ),
Show Simultaneous CI( 1 ),
Weibull Fit( 1 )
//Save Estimates
)
)
);
If( !validated, Stop() );
dt2 = Data Table( dtname || " Survival");
columnnamegroup = Column( dt2, 1 ) << Get Name;
Groups = Column( dt2, columnnamegroup ) << Get As Matrix;
Show( Groups );
Jordan