こんにちは、
私はJMPスクリプトの経験の浅いユーザーで、新しい列を追加する方法のヘルプが必要です。新しい列のデータは、固定数のユーザーによって定義されます。つまり、コードを実行するときはいつでも、新しい列に入力するために必要な数を問い合わせる必要があります。実際、同じデータテーブルに入力するために必要な数とタスク(新しい列)は異なります。
リクエストを理解した場合、値のユーザーとして、その値を数式で使用したいようです。 これはあなたが始めるのに役立つかもしれません:
//Make sure variables names defined here do not interfere with other scripts
Names default to here(1);
//start by opening a data table. Instead of this, you could just use
// dt = current data table();
dt = Open("$Sample_Data/iris.jmp");
dt << New Script(
"New Column",
//Open a new window which...
win = New Window ( "Create a column",
Show Menu( 0 ),
Show Toolbars( 0 ),
v list box(
Text Box( "Add a new column."),
Spacer box( Size( 20,20 ) ),
//asks the user for a column name...
Text Box("Enter a column name"),
tebName = Text Edit Box( "Column 1", Set Width( 200 ) ),
Spacer box( Size( 10,10 ) ),
//and a value...
Text Box("Enter a value in the column"),
nebValue = Number Edit Box( 0 ),
Spacer box( Size( 10,10 ) ),
H list box(
//and includeds a button with a script that creates the column...
Button Box( "Create A Column",
//Use Eval, Eval Expr, and Expr to put the RESULT of the expression "nebValue << Get" into the formula
//instead of the expression itself
Names default to here( 1 );
dt = current data table();
Eval( Eval Expr(
dt << New Column( tebName << Get Text, Numeric, "Continuous", Format("Best", 12), Formula( Expr( nebValue << Get ) ) )
) )
),
//and another button to close the window.
Button Box( "Close",
win << Close Window
)
)
)
);
);こんにちは、
あなたの助けに感謝し、それは主に私のスクリプトを完了するのに役立ちます。実際、私の仕事と使命は、完全なデータが含まれていないcsvファイルを引き出して、可変データで完全にするために、プロジェクトによって異なります。あなたのコードが私をさらに助けているようですので、今、私は最初の段階から単一のコードだけを使ってグラフを得るまで組み合わせる方法を考える必要があります。おそらくそれは可能であり、助言するためにこのコミュニティグループの専門家も必要です。どうもありがとうございました。