在 JMP 腳本的早期,我定義了一個字串變量,如下所示:
Trim0 = "trim_lvl_a";
我的資料表中有一個名為trim_lvl_a 的欄位。稍後在腳本中,我會建立一個圖形產生器腳本,如下所示:
dt << New Script(
"maps",
Graph Builder(
Size( 550, 647 ),
Graph Spacing( 5 ),
Variables(
X( :X ),
Y( :Y ),
Group Y( :Name( "Tambient (degC)" ) ),
Wrap( :LotWafer ),
Color( Column(Trim0) )
),
Elements( Points( X, Y, Legend( 3 ) ) ),
Local Data Filter(
Add Filter(
columns( :LotWafer, :Name( "Tambient (degC)" ) ),
Where( :Name( "Tambient (degC)" ) == 25 ),
Display( :LotWafer, Size( 224, 105 ), List Display )
)
),
SendToReport(
Dispatch(
{},
"X",
ScaleBox,
{Min( -5 ), Max( 60 ), Inc( 5 ), Minor Ticks( 0 ),
Label Row( Show Major Grid( 1 ) )}
),
Dispatch(
{},
"Y",
ScaleBox,
{Min( -5 ), Max( 60 ), Inc( 5 ), Minor Ticks( 0 ),
Label Row( Show Major Grid( 1 ) )}
)
)
);
);The problem is where I try to use the Trim0 string constant in the Color part of the graph builder. Once my JMP script executes and the graph builder script called "maps" is saved to my data table dt, then when I click on the "maps" script in dt, it fails to execute and bring up the graph. How can I use my string variable Trim0 within this graph builder to refer to the desired column in my data table? I do not want to have to hard-wire the colulmn name trim_lvl_a into the Color part of the graph builder script. Thanks.</CODE></P><P> </P></LINGO-BODY><LINGO-LABS id="lingo-labs-741117" slang="en-US" mode="CREATE"><LINGO-LABEL>自動化和腳本編寫</LINGO-LABEL></LINGO-LABS><LINGO-SUB id="lingo-sub-741157" slang="en-US" mode="CREATE">回覆:在圖形產生器腳本中使用字串變數</LINGO-SUB><LINGO-BODY id="lingo-body-741157" slang="en-US" mode="CREATE"><P>在將程式碼提交到 JMP 之前,您需要評估 trim0。對腳本進行以下修改應該可以滿足您的需求。</P>
<PRE><CODE class=" language-jsl">Eval(
Eval Expr(
dt << New Script(
"maps",
Graph Builder(
Size( 550, 647 ),
Graph Spacing( 5 ),
Variables(
X( :X ),
Y( :Y ),
Group Y( :Name( "Tambient (degC)" ) ),
Wrap( :LotWafer ),
Color( Column( Expr( Trim0 ) ) )
),
Elements( Points( X, Y, Legend( 3 ) ) ),
Local Data Filter(
Add Filter(
columns( :LotWafer, :Name( "Tambient (degC)" ) ),
Where( :Name( "Tambient (degC)" ) == 25 ),
Display( :LotWafer, Size( 224, 105 ), List Display )
)
),
SendToReport(
Dispatch(
{},
"X",
ScaleBox,
{Min( -5 ), Max( 60 ), Inc( 5 ), Minor Ticks( 0 ), Label Row( Show Major Grid( 1 ) )}
),
Dispatch(
{},
"Y",
ScaleBox,
{Min( -5 ), Max( 60 ), Inc( 5 ), Minor Ticks( 0 ), Label Row( Show Major Grid( 1 ) )}
)
)
)
)
)
);