大家好,
我有以下問題:我正在創建一系列選項卡參數概述窗戶。 這些選項卡是在「for」循環中產生的。 然而,在最後一個選項卡之後,我想再建立一個在 for 循環之外建立的選項卡。 從“for”循環生成選項卡效果很好,但添加最後一個選項卡則不然。 如果我手動選擇最後一個選項卡的程式碼並執行它,那麼所需的選項卡也會顯示在視窗中。 用於在“for”循環資料表中建立選項卡dt_運行用來。 為了創建最後一個選項卡,使用另一個表: zuv_數據。 如何啟動最後一個選項卡的生成? 我將不勝感激如何做到這一點的提示和建議。為了簡化程式碼結構,我刪除了每個圖是如何建立的內容。
此致。
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() 迴圈是一個無限迴圈。您的程式碼的結束元素永遠不會到達。
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 ) )
)
)
)
)
);