I was wondering if someone could offer a solution for how to allow the Summary input box to show up but have the "Linked to source data" option unchecked. I tried this: dt<<summary(link to original data table(0)); but it just runs the summary with nothing selected. For right now I'm using just dt<<summary(); but I have to remember to click the check box or else when my macro closes the table being summarized the summarized table closes as well.
names default to here(1);
dt=current data table();
selrows=dt<<get selected rows;
dt2=dt<<subset(selrows, selected columns(0),"invisible",);
If(
ex = New Window( "Press to continue",
<<Modal,
<<Return Result,
V List Box(
H List Box( Button Box( "OK" ), Button Box( "Cancel" ) ),
obj=dt2<<summary(),
)
);
ex["button"] == 1;
,
ex["variable"],
"CANCEL"
);
dt3=current data table();
close(dt2,nosave);
Here is a method that permits the Link to Original Data Table to be unchecked,
txnelson_0-1646065769460.png
And the code for the remaining script not to be run until the Summary window is processed
Names Default To Here( 1 );
// → Data Table( "big class" )
dt = Open( "$SAMPLE_DATA/big class.jmp" );
obj = dt << summary();
win = Window( "Summary" );
(win[CheckBoxbox( 2 )]) << set( 1, 0 );
win << onclose(
Show( "done" );
//additional code to be processed once window is closed
);
Seems that Summary is executed directly when there is any argument. And did not find Preferences for Summary either. So I did not find a simple solution.
One workaround would be to generate a modal window to select the input you need to perform summary (e.g. col list box etc. to query ..).
But in your case, why do you wrap the dialog for Summary in a modal window? It would work perfectly w/o.
Thanks for looking into it Georg,
Looks like I'll add in the collist box like you said, was just looking to be lazy! Also, the modal is in there because I copied that portion of script from another one and just didn't do much clean up, so once again being lazy.
Steve
Here is a method that permits the Link to Original Data Table to be unchecked,
txnelson_0-1646065769460.png
And the code for the remaining script not to be run until the Summary window is processed
Names Default To Here( 1 );
// → Data Table( "big class" )
dt = Open( "$SAMPLE_DATA/big class.jmp" );
obj = dt << summary();
win = Window( "Summary" );
(win[CheckBoxbox( 2 )]) << set( 1, 0 );
win << onclose(
Show( "done" );
//additional code to be processed once window is closed
);
Perfect thanks Jim!