大家好,
最近我开始接触 jmp 脚本,并且正在尽力学习它。
下面示例的目标是显示所选行的“列”值。
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 ),
);<BR />
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] );
);
);<BR />
my_obj = New Object( Test_Class( dt, Cols ) );错误代码:
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
我尝试在类之外使用该脚本,它似乎有效,您是否知道上述实现有什么问题。
你好,
您没有提及您使用的 JMP 版本。这对于我使用 JMP 17 效果很好。您的脚本顶部有以下内容吗?
名称默认为此处( 1 );
如果您运行多个脚本,则可能会有所不同。
布赖恩·科科伦
JMP开发
你有什么具体的理由用类来构建这个吗?如果您刚刚开始使用 JMP 脚本编写,我想说远离课堂可能是个好主意。
你好布莱恩,
抱歉,没有更具体,上面的脚本运行,但按下 SelectedRows 按钮时出现错误。
我在 JMP 17 上运行它。