I made some modifications to your Script A. Basically, the changes were to ensure that variables that are being called have been defined prior to the calling of them. I added the Clear Symbols(); which helps with making sure the variables are not hanging around.
Clear Symbols();
DT = open("data.jmp", invisible);
//Making graphs
myFinalDisplay = Expr(
//Getting the inputs
x = inputParameter << get Selected;
y = response << get Selected;
z = blocking << get Selected;
myGbDispObj = dt << Bivariate(
Size( 550, 400 ),
Y( Eval( y ) ),
X( Eval( x ) ),
Automatic Recalc( 1 ),
Histogram Borders( 1 ),
Summary Statistics( 1 ),
Fit Spline( 2, {Line Color( {212, 73, 88} )} ),
SendToReport(
Dispatch(
{},
"Bivar Plot",
FrameBox,
{Row Legend(
Eval( z ),
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 1 ),
Marker Theme( "Solid" ),
Continuous Scale( 1 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
),
Dispatch( {}, "Summary Statistics", OutlineBox, {Close( 1 )} )
)
);
myLimitCol = Column( DT, Eval( x ) );
myLimitMin = Col Minimum( myLimitCol );
Show( myLimitMin );
myLimitMax = Col Maximum( myLimitCol );
Show( myLimitMax );
myTbLo = Text Box( Char( Round( myLimitMin, 2 ) ) || " (OOC = " || Char( 0.00, 10, 2 ) || "%)" );
myTbHi = Text Box( Char( Round( myLimitMax, 2 ) ) || " (OOC = " || Char( 0.00, 10, 2 ) || "%)" );
mySbDispObj = Range Slider Box(
myLimitMin,
myLimitMax,
mySelectedLower,
mySelectedUpper,
//script
//mySelectedLower = mySbDispObj << getLower;
//mySelectedUpper = mySbDispObj << getUpper;
myGbDispObj << Dispatch( {}, "1", ScaleBox, {Add Ref Line( mySelectedLower, "Dashed", "blue", "LCL", 4 )} );
myGbDispObj << Dispatch( {}, "1", ScaleBox, {Add Ref Line( mySelectedUpper, "Dashed", "blue", "UCL", 4 )} );
rUpper = dt << Get Rows Where( myLimitCol[] > mySelectedUpper );
OOC_valUpper = (N Items( rUpper ) / N Rows( dt )) * 100;
myTbHi << setText( Char( Round( mySelectedUpper, 1 ) ) || " (OOC = " || Char( OOC_valUpper, 10, 2 ) || "%)" );
rLower = dt << Get Rows Where( myLimitCol[] < mySelectedLower );
OOC_valLower = (N Items( rLower ) / N Rows( dt )) * 100;
myTbLo << setText( Char( Round( mySelectedLower, 1 ) ) || " (OOC = " || Char( OOC_valLower, 10, 2 ) || "%)" );
);
mySbDispObj << Set Width( 275 );
myLayout = V List Box( myGbDispObj, H List Box( myTbLo, Spacer Box( size( 50, 0 ) ), myTbHi ), mySbDispObj );
);
//PLATFORM = newWindow("TEST", vListBox(myFinalDisplay));
The only change to Script B was to add scoping clarification to the "response" variable. You are using it in the script and it is also a column name. JMP was getting confused. So by adding "::" in front of it, it forced JMP to look for a memory variable, not a column for it's usage
myStaticLibContainer = vListBox(); //Making a static container
//////Calling the expression "myFinalDisplay" from ScriptA and adding it to the static container//////
sliderGraph = buttonBox("Get Slider Graph", myStaticLibContainer << append(vListBox(myFinalDisplay)));
///Creating user input boxes///
inputParameter = comboBox("Parameter");
::response = comboBox("Response");
blocking = comboBox("FAB");
myMainToolPanelBox = panelBox("myMainToolPanelBox",
vListBox(
spacerBox(size(1000,0)),
V List Box(Text Box("Predictor"), inputParameter),
V List Box(Text Box("Response"), response),
V List Box(Text Box("Block By"), blocking)),
H List Box(sliderGraph),
scrollBox(size(1000,550), myStaticLibContainer),
);
myPlatform = newWindow("Loss Curves", myMainToolPanelBox);
Jim