大家好,
我遇到以下問題:我正在創建一系列標籤參數概述窗口。 這些選項卡在“ for”循環中生成。 但是,在最後一個選項卡之後,我想在for循環之外再創建一個選項卡。 從“ for”循環生成的選項卡效果很好,但是最後一個選項的添加卻不能。 如果我手動選擇最後一個選項卡的代碼並執行它,則所需的選項卡也會顯示在窗口中。 用於在“ for”循環中創建選項卡的數據表dt_run用來。 為了創建最後一個選項卡,使用了另一個表: zuv_data 。 如何激活最後一個標籤頁的生成? 我將為您提供提示和建議,以幫助您實現此目標。我刪除瞭如何創建每個圖的內容,以簡化代碼結構。
最好的祝福。
New Window( "Param_Overview", tb = Tab Box() );
For( iRun = 1, nitems(run_list), iRun++,
tb << Add(
//todo
Lineup Box( N Col( 1 ),
Outline Box( "Graph1",
H List Box(
dt_run << Graph Builder(
// todo
)
),
dt_run << Graph Builder(
// todo
)
)
)
),
Outline Box( "Graph2",
hlistbox = H List Box(
dt_run << Graph Builder(
// todo
)
),
dt_run << Tabulate(
// todo
)
)
)
)
)
);
// the last tab
tb << Add("last tab", //add one more tab
Outline Box( "Last_Graph",
H List Box(
zuv_data << Graph Builder(
// todo
)
)
)
);我填寫了示例腳本,並更正了一些語法問題,並且代碼運行無誤。
失誤
- 您的For()循環是一個無限循環。您的代碼的結尾元素永遠不會到達。
For( iRun = 1, nitems(run_list), iRun++,
它必須是For( iRun = 1, iRun <= nitems(run_list), iRun++,
- For循環中具有匹配的“)”存在問題
這是我對代碼的修改
Names Default To Here( 1 );
dt_run = open("$SAMPLE_DATA/big class.jmp");
zuv_data = open("$SAMPLE_DATAbig class families.jmp");
run_list = {a, b};
New Window( "Param_Overview", tb = Tab Box() );
For( iRun = 1, iRun <= N Items( run_list ), iRun++,
tb << Add(
//todo
Lineup Box( N Col( 1 ),
Outline Box( "Graph1",
H List Box(
dt_run << Graph Builder(
Size( 528, 450 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ) )
)
),
dt_run << Graph Builder(
Size( 528, 450 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ) )
)
)
),
Outline Box( "Graph2",
hlistbox = H List Box(
dt_run << Graph Builder(
Size( 528, 450 ),
Show Control Panel( 0 ),
Variables( X( :age ), Y( :height ) ),
Elements( Points( X, Y, Legend( 3 ) ) )
)
),
dt_run << Tabulate(
Show Control Panel( 0 ),
Add Table(
Column Table( Analysis Columns( :height, :weight ), Statistics( Mean ) ),
Row Table( Grouping Columns( :age ) )
)
)
)
)
);
// the last tab
tb << Add(
"last tab", //add one more tab
Outline Box( "Last_Graph",
H List Box(
zuv_data << Tabulate(
Show Control Panel( 0 ),
Add Table(
Column Table( Analysis Columns( :height, :weight ), Statistics( Mean ) ),
Row Table( Grouping Columns( :age ) )
)
)
)
)
);謝謝!,它正在工作。 我完全沒有註意到For()循環中的錯誤。 這就是為什麼它無法顯示最後一個選項卡的原因。 此致