大家好,
最近我開始接觸 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 上運行它。