There are a few issues with your script......all minor
- Your New Window, which is the control part of your code, needs to be after all of the code that is going to be called. That is, you can not call doListChoice before JMP has read doListChoice in. JSL is an interpreter, it starts reading code on line one, and then just follows where the code takes it.
- The way you had your code structured, with the New Window towards the top, meant that it was always using the code from the previous run. JMP retains the code from run to run, unless told otherwise. I have placed a Clear Globals() in your code to make sure everything is cleared out for each run.
- You were referencing the xvar and yvar improperly. I have changed that code slightly to make it work.
- The code was getting confused on what data table to process. I have added dtNames and dt to allow for the code to point to the data to make it clearer
Clear Symbols();
Names Default To Here( 1 );
//current data table that has data on individual equipment based on each week
filepath="C:\temp_files\jmp\tool time vs CW\#jmp-script\for jmp SAS community QA\Untitled 90.jmp";
dtNames = Open(filepath,invisible);
//equipment list (will go upto 100 [equip 1 , equip 2 ,..........equip 100], only shows 2 here for example)
filepath="C:\temp_files\jmp\tool time vs CW\#jmp-script\for jmp SAS community QA\Equipment Name-wf.jmp";
dt = Open(filepath,invisible);
//dtNames = Data Table( "Equipment Name-wf" );
//dt = Data Table( "Untitled 90 (1)" );
doListChoice = Expr(
choice = myListbox << getSelected; // choosing the equipment name from the drop down list
Tool_time_wf( "week", choice ); //does not work
);
//Tool_time_wf(week column, tool name in string quotes works);
Tool_time_wf = Function( {xvar, yvar},
bivExpr = dt << Graph Builder(
Size( 534, 464 ),
Show Control Panel( 0 ),
Variables( X( Eval( xvar ) ), Y( Eval( yvar ) ) ),
Elements( Bar( X, Y ) )
)
);
myList = Column( Data Table( "Equipment Name-wf" ), 1 ) << Get Values;
myListbox = Combo Box( myList, doListChoice );
//@@//showing drop down -works-st
New Window( "Show List",
Text Box(
" Please select a TOOL/MACHINE from the drop down menu:",
<<font color( "Blue" ),
<<Set Font( "Arial Black" ),
<<Set Font Size( 8 ),
<<Set Font Style( "Regular" )
),
myListbox
);
Jim