In the script below all the data from my table is deleted before I can run the data boxes.
I am trying to delete any data outside of my date range.
Can I use modal somehow?
Thx - Matt
_____________________________________________________________
//Open and reset all names, ask for date
Names Default To Here( 1 );
dt_run = Open( "data.jmp");
//wait for open
wait(0);
dt_run << clear row states;
dt_run << Clear Column Selection();
startNW = New Window( "Start",
///<<Modal,///does not allow script or user to go on until text box answered
StartDate << Max Date( Col Max( :name( "Date" ) ) ) << Min Date( Col Min( :Name( "Date" ) ) );
StartDate = Calendar Box(),
Button Box( "OK",
startNW << close window;
StartDate << Set Function( Function( {this, date}, theStartDate = StartDate << Get Date ) );
)
);
runEndDate = Expr(
endNW = New Window( "End",
EndDate = Calendar Box(),
Button Box( "OK",
endNW << close window;
runSelect;
)
);
endDate << Max Date( Col Max( :name( "Date" ) ) ) << Min Date( Col Min( :Name( "Date" ) ) );
EndDate << Set Function( Function( {this, date}, theEndDate = endDate << Get Date ) );
);
runSelect = Expr(
dt_run << select where( :Name( "Date" ) > theStartDate & :Name( "Date" ) < theEndDate )
);
dt_run << Invert Row Selection();
dt_run << Delete Rows();