How to use variable selected in combo box data extraction pathHi,
I'm quite new to JMP, got script with combo box and intending to use the selected character to be insert into the path for data extraction , any suggestion welcome .
Thanks
Names Default To Here( 1 );
Clear Symbols();
Clear Globals();
New Window( "Combo box test",
<Panel Box( "Select a Date Range",
Lineup Box( N Col( 1 ),
text box("DCOP ID"),
dc_cb = Combo Box( {"CED15_10", "CDM45.10", "CRL02.05","CEM11.05","CEM09.18","CBI07.01" }, dc_cb << GetSelected() , <
,
),
H List Box(
Button Box( "OK",
<Function( {self},
dcop_id = dc_cb << Get;
)
)
),
Button Box( "Cancel" )
),
),
);
dt_control = Open(
"\\S:data\ENG_" || dcop_id || ".CSV"
ScriptingRe: How to use variable selected in combo box into data extraction pathThe message Get returns an integer from the combobox, I think you instead want Get Text. See this updated script:
Names Default To Here( 1 );
New Window( "Combo box test",
<< Modal,
Panel Box( "Select a Date Range",
Lineup Box( N Col( 1 ),
Text Box( "DCOP ID" ),
dc_cb = Combo Box(
{"CED15_10", "CDM45.10", "CRL02.05", "CEM11.05", "CEM09.18", "CBI07.01"},
dc_cb << GetSelected(),
<< Set Width( 20 )
)
),
H List Box(
Button Box( "OK",
<<SET function=""></SET>
Check out the scripting index to see more detail on those messages.

Re: How to use variable selected in combo box into data extraction pathSweet, works nice.
Any chance I could use combo box and get outcome as a number?
Names Default To Here( 1 );
New Window( "Combo box test",
<< Modal,
Panel Box( "Select a Date Range",
Lineup Box( N Col( 1 ),
Text Box( "DCOP ID" ),
dc_cb = Combo Box(
{"10", "20", "30"},
dc_cb << GetSelected(),
<< Set Width( 20 )
)
),
H List Box(
Button Box( "OK",
<<SET function=""></SET>Re: How to use variable selected in combo box into data extraction pathAll you need to do is to use the Num() function to convert the character string to numeric. Also, you need to use the Get Selected message, not the Get message. Get Selected returns the value, while Get returns the index number.
See the Scripting Index for definition of the messages available to the Combo Box().
dcop_id = Num( dc_cb << Get Selected ) ;
I strongly suggest that you take the time to read the Scripting Guide found in the JMP Documentation Library, under the Help Menu. It will really provide you with the background that will make your venture into JSL a far easier task.
Re: How to use variable selected in combo box into data extraction pathThanks a lot, that works perfectly, will do.
Thanks again