Hi, I have a really basic question: I am running the following script but I want to have a user interface that allows the user to select an option. Based on the option that is selected, a portion of the script is run. Can you kindly help with that or refer to an example which I can use in my script.
Below is the not the complete script, it is just to highlight that the script has multiple portions, some are just Overlay plots and some summaries or joining. I want to know how to can I execute portion of a script if a specific option is selected by the user and how to end this if user cancels or clicks on "x" on the pop-up window.
//***********
overlayPlot = {"ByTestHead","ByDuts","EntireFleetOn1Dut" };
Options = new window("Overlay Plot",<<modal,
Text box("Choose Overlay Plot Type", <<set width (180)),
cb1 = combo Box( overlayPlot ),
h list box(
Button Box( "OK"),
Button Box( "Cancel")
),
);
//Cancel script if Cancel Button selected
BB = Options["Button"];
if(BB==-1, throw(),);
//If "ByDuts" is slected by user run this section
//***********Overlay By DUT**************
jrnl1= Overlay Plot(
X( :Name( "Min(X)" ) ),
Y( :Name( "Min(Y)" ) ),
Grouping( :DUT ),
Overlay Groups( Group[1] << Group Color( 32 ) << Group Marker( 0 ) ),
SendToReport(
Dispatch( {}, "Overlay Plot", OutlineBox, {Set Title( "This one" )} ),
Dispatch(
{},
"Overlay Plot Graph",
FrameBox( 14 ),
{Frame Size( 660, 570 )}
),
Dispatch(
{},
"",
LegendBox,
{Set Title( "Groups" ), Orientation( "Vertical" )}
)
)
);
jrnl1 <<journal;
//If "ByTestHead" is slected by user run this section
//**************By Test Head******************
jrnl2= Overlay Plot(
X( :Name( "Min(X)" ) ),
Y( :Name( "Min(Y)" ) ),
Grouping( :DUT ),
Overlay Groups( Group[1] << Group Color( 32 ) << Group Marker( 0 ) ),
SendToReport(
Dispatch( {}, "Overlay Plot", OutlineBox, {Set Title( "This one" )} ),
Dispatch(
{},
"Overlay Plot Graph",
FrameBox( 14 ),
{Frame Size( 660, 570 )}
),
Dispatch(
{},
"",
LegendBox,
{Set Title( "Groups" ), Orientation( "Vertical" )}
)
)
);
jrnl2 <<journal;
//If "EntireFleetOn1Dut" is slected by user run this section
//*****************By DiePin Burn Count**************
kb4=Data Table( "damagehistory" );
kb4<< Summary(
Group( :DiePin ),
Freq( "None" ),
Weight( "None" ),
output table name( "DiePinBurnCount" )
);
kb5=Data Table( "Dutref" );
kb5 << Join(
With( Data Table( "DiePinBurnCount" ) ),
Select( :DiePin, :Name( "Min(X)" ), :Name( "Min(Y)" ) ),
SelectWith( :N Rows ),
By Matching Columns( :DiePin = :DiePin ),
Drop multiples( 0, 0 ),
Include Nonmatches( 1, 1 ),
Preserve main table order( 1 ),
Output Table( "OverlayByDiePinBurn" )
);
kb6=Data Table ("OverlayByDiePinBurn");
kb6 <<New Column("# of Times Failing", Numeric, "Continuous", Format("Best", 12), Formula(If(Is Missing(:N Rows), 0, :N Rows)));
Overlay Plot(
X( :Name( "Min(X)" ) ),
Y( :Name( "Min(Y)" ) ),
Grouping( :Name( "# of Times Failing" ) ),
Overlay Groups(
Group[1] << Group Color( 80 ) << Group Marker( 0 ),
Group[2] << Group Color( 80 ),
Group[3] << Group Color( 73 ),
Group[4] << Group Color( 73 ),
Group[5] << Group Color( 73 ),
Group[6] << Group Color( 73 ),
Group[7] << Group Color( 73 ),
Group[8] << Group Color( 70 ),
Group[9] << Group Color( 70 ),
Group[10] << Group Color( 70 ),
Group[11] << Group Color( 70 ),
Group[12] << Group Color( 70 ),
Group[13] << Group Color( 70 ),
Group[14] << Group Color( 70 ),
Group[15] << Group Color( 38 ),
Group[16] << Group Color( 38 ),
Group[17] << Group Color( 38 ),
Group[18] << Group Color( 35 ),
Group[19] << Group Color( 3 ),
Group[20] << Group Color( 3 ),
Group[21] << Group Color( 19 ),
Group[22] << Group Color( 19 ),
Group[23] << Group Color( 51 ),
Group[24] << Group Color( 51 )
),
SendToReport(
Dispatch( {}, "Overlay Plot", OutlineBox, {Set Title( "What else" )} ),
Dispatch(
{},
"Overlay Plot Graph",
FrameBox( 25 ),
{Frame Size( 719, 632 )}
),
Dispatch(
{},
"",
LegendBox,
{Set Title( "Groups" ), Orientation( "Vertical" )}
)
)
);