cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar

Process Screening within JSL class

Hello Everyone,

Recently I got into jmp scripting, and am trying my best to learn it.

 

The goal of the example below is to show the value of the "Column" for the selected rows.

Cols = {"NPN1", "PNP1", "PNP2", "NPN2", "PNP3", "IVP1", "PNP4", "NPN3", "IVP2", "NPN4", "SIT1", "INM1", "INM2",
"VPM1", "VPM2"};
dt = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );

Define Class(
	"Test_Class",
	_init_ = Method( {dt, Cols},
		my_dt = dt;
		my_cols = Cols;
		
		Make_Win();
	);
	
	Make_Win = Method( {}, 
		New Window( "ProcessScreening", 
			Vlist_box = V List Box(
				PS,
				MyButton = Button Box( "SelectedRows", SendRows ),
			),
		),
	);

	PS = dt << Process Screening(
		Y( Eval(my_cols)),
		Control Chart Type( "Indiv and MR" ),
		Minimum Process Length( 1 ),
		Use Medians instead of Means( 1 ),
		Show tests( 0 ),
		Test 1( 0 ),
		Cp( 1 ),
		Spec Limits( 1 ), 
	);
SendRows = Expr( print_cols = Report( PS )[Table Box( 1 )][String Col Box( 1 )] << getselectedrows(); Print( Report( PS )[Table Box( 1 )][String Col Box( 1 )][print_cols] ); ); );
my_obj = New Object( Test_Class( dt, Cols ) );

Error code:

Send Expects Scriptable Object in access or evaluation of 'Send' , my_dt <<  /*###*/Process Screening(
Y( Eval( my_cols ) ),
Control Chart Type( "Indiv and MR" ),
Minimum Process Length( 1 ),
Use Medians instead of Means( 1 ),
Show tests( 0 ),
Test 1( 0 ),
Cp( 1 ),
Spec Limits( 1 )
) /*###*/
object not subscriptable in access or evaluation of 'Report(PS)[ /*###*/Table Box(1)]' , Report( PS )[/*###*/Table 

 

I tried to use the script outside a class and it seems to work, do you have any clue of what is wrong with the above implementation.

 

3 REPLIES 3

Re: Process Screening within JSL class

Hi,

You don't mention what version of JMP you are using.  This worked fine for me with JMP 17. Do you have the following at the top of your script?

names default to here(1);

If you have several scripts running, it can make a difference.

 

Brian Corcoran
JMP Development




Re: Process Screening within JSL class

Hello Brian,

 

Sorry for not being more specific, the above script runs but the error appears pressing the SelectedRows button.

I am running this on JMP 17.

 

 

jthi
Super User

Re: Process Screening within JSL class

Do you have some specific reason for building this with classes? If you are just starting out with JMP scripting I would say staying away from classes might be a good idea.

-Jarmo