The value returned from
cb << Get Selected()
is a JMP List. The reason for this, is that more than one value can be selected in the Check Box(). Elements from a list can be referenced independently from the entire list, by specifying a subscript. This was the question in your first question. Therefore,
returned = (cb << Get Selected())[1];
returns the first item from the list.
From your latest entry, I don't believe you need to deal with the individual elements of the list, to accomplish the generation of the Tabulate. Below is a simple example using your input window, that should show you how to handle the information coming out of the Check Box(). The code also uses one method of handling the situation when no statistic has been selected. I changed the New Window to a "Modal" window. A New Window by default, does not stop the processing in a JMP script. However, a Modal window does stop the processing and waits for the user input before continuing with the processing. To answer your question about Cp and Cpk, the Tabulate Platform does not have Cp or Cpk available.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
returned = {};
New Window( "Example",
<<modal,
cb = Check Box(
{"Max", "Median", "Min", "Mean", "Std Dev"},
returned = (cb << Get Selected());
Print( returned ) //{"Mean", "Std Dev"} or etc
;
)
);
If( N Items( returned ) == 0,
Dialog( "You must select at least one statistic" );
Throw();
);
Tabulate(
Show Control Panel( 0 ),
Add Table(
Column Table( Statistics( Eval( returned ) ), Analysis Columns( :height ) ),
Row Table( Grouping Columns( :age ) )
)
);
I strongly suggest that you take the time to read the Scripting Guide. I will give you the base information about the JSL structures, such as Lists, and platform utilization, such as Tabulate, which will make your development of JMP Scripts much easier.
The Scripting Guide is found in the JMP Documentation Library, available under the Help pull down menu.
Jim