Subscribe Bookmark RSS Feed

Embedding scripts into a display box in JMP9

jay_holavarri

Community Trekker

Joined:

Mar 18, 2016

We use old JMP9 licenses on production floor PC's and JMP13 for most engineers with a job requiring data analysis. It's frequently handy for me to convert a JMP13 script into something that runs on JMP9.

 

Does anyone know/remember if you can attach a script to checkbox such that it runs a function whenever a box is checked. At some point, it looks like JMP introduced a 'set function' message that I use in JMP13 scripts, but it doesn't appear to be available in JMP9. I'd like to know if the functionality isn't there, or if the method is just different.

 

Here is an example of using 'set function' in JMP13.

 

panelBox_filter << Append(cb_filter = Check Box(filterList,
<< Set Function(Function({this, icheck},
cb_request_sel = this << get selected;
If( Contains(cb_request_sel, "TR") > 0, filterTr = 1, filterTr = 0);
fnShow(filterTr, pb_tr);
If( Contains(cb_request_sel, "Date") > 0, filterDate = 1, filterDate = 0);
fnShow(filterDate, pb_Date);
If( Contains(cb_request_sel, "Product Type") > 0, filterProdType = 1, filterProdType = 0);
fnShow(filterProdType, pb_ProdType);
If( Contains(cb_request_sel, "Pens") > 0, filterPens = 1, filterPens = 0);
fnShow(filterPens, pb_pens)
))
));
 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
melaniedrake

Staff

Joined:

May 30, 2014

Solution

Set Function was added in JMP 10, so JMP 9 will not recognize it. You can rewrite using Set Script. Something like this:

 

panelBox_filter << Append(
	cb_filter = Check Box(
		filterList,
		<<Set Script(
			cb_request_sel = cb_filter << get selected;
			If( Contains( cb_request_sel, "TR" ) > 0,
				filterTr = 1,
				filterTr = 0
			);
			fnShow( filterTr, pb_tr );
			If( Contains( cb_request_sel, "Date" ) > 0,
				filterDate = 1,
				filterDate = 0
			);
			fnShow( filterDate, pb_Date );
			If( Contains( cb_request_sel, "Product Type" ) > 0,
				filterProdType = 1,
				filterProdType = 0
			);
			fnShow( filterProdType, pb_ProdType );
			If( Contains( cb_request_sel, "Pens" ) > 0,
				filterPens = 1,
				filterPens = 0
			);
			fnShow( filterPens, pb_pens );
		)
	)
);
3 REPLIES
markbailey

Staff

Joined:

Jun 23, 2011

I don't have JMP 9 installed so I cannot verify this claim but I think if you change the Set Function message to Set Script and remove the function parameters, the expression should be evaluated when the user clicks a check box.

Learn it once, use it forever!
melaniedrake

Staff

Joined:

May 30, 2014

Solution

Set Function was added in JMP 10, so JMP 9 will not recognize it. You can rewrite using Set Script. Something like this:

 

panelBox_filter << Append(
	cb_filter = Check Box(
		filterList,
		<<Set Script(
			cb_request_sel = cb_filter << get selected;
			If( Contains( cb_request_sel, "TR" ) > 0,
				filterTr = 1,
				filterTr = 0
			);
			fnShow( filterTr, pb_tr );
			If( Contains( cb_request_sel, "Date" ) > 0,
				filterDate = 1,
				filterDate = 0
			);
			fnShow( filterDate, pb_Date );
			If( Contains( cb_request_sel, "Product Type" ) > 0,
				filterProdType = 1,
				filterProdType = 0
			);
			fnShow( filterProdType, pb_ProdType );
			If( Contains( cb_request_sel, "Pens" ) > 0,
				filterPens = 1,
				filterPens = 0
			);
			fnShow( filterPens, pb_pens );
		)
	)
);
jay_holavarri

Community Trekker

Joined:

Mar 18, 2016

 

Thank you Melanie and Mark! That was just what I needed to know. -jay