For Loop 在選項卡框中,每個循環在窗口中創建一個不同的選項卡我正在嘗試循環遍歷工具的變量列表(ChamberTool 或 Cham)來創建列表。然後使用該列表,我按日期創建數據輪廓,其中每個室都是選項卡框窗口上的單獨選項卡。我已經獨立完成了這些事情,但我的特殊問題是為這個變量列表中的每個工具創建一個選項卡。也許我的方法還很遙遠,但這是我的腳本。
首先,這是我可以使用的兩個腳本。我移交了我已經知道如何做的部分的腳本,並使這篇文章更加簡短,並且不偏離我的主要問題陳述。
ContourG = dt << Contour stuff here;
Graph = new window("Contours", tab box(
"Tab Name Here", (vlistbox(ContourG)),
));但是當我嘗試運行 for 循環時,我完全崩潰了。
Cham = Associative Array(Column(dt_stacked, "Chamber") << Get Values) << Get Keys;Associative Array(Column(dt_stacked, "Chamber")<< Get Values)<<GET keys=""></GET>
回复:選項卡框中的 For 循環,其中每個循環在窗口中創建不同的選項卡這是一個在一個窗口中生成預構建分析的腳本,第二個窗口實時動態生成顯示。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
// Create the default lists
namesList = {};
objList = {};
// Generate the output names
For( i = 1, i <= 10, i++,
Insert Into( namesList, "Analysis " || Char( i ) )
);
//Pre run the reports
For( i = 1, i <= 10, i++,
objList[i] = V List Box( Oneway( x( :Site ), y( Column( i + 4 ) ) ) )
);
// Create the display window for to display the prebuilt reports upon a user's reques
nw = New Window( "Output PreBuilt",
theHLB = H List Box(
lB = List Box(
namesList,
maxselected( 1 ),
Try( myObj << delete );
theHLB << append( myObj = objList[Contains( namesList, (lB << get selected)[1] )] << clone box );
)
)
);
// Create the display window for the displaying of the dynamically created reports
nw2 = New Window( "Output Dynamic Creation",
theHLB2 = H List Box(
lB2 = List Box(
namesList,
maxselected( 1 ),
Try( myObj2 << delete );
theHLB2 << append(
myObj2 = V List Box(
Oneway( x( :Site ), y( Column( Contains( namesList, (lB2 << get selected)[1] )+4 ) ) )
)
);
)
)
);回复:選項卡框中的 For 循環,其中每個循環在窗口中創建不同的選項卡感謝您的意見。 我的報告將為每個功能生成大約 8-10 個圖表,圖表類型會因功能類型而異,每層有 3-8 個功能,每個產品最多 10 層,產品可能會根據數據提取的天數而變化。是否可以將所有繪圖/圖表存儲在列表或數組中,以便通過 FOR 循環更輕鬆地訪問?
回复:選項卡框中的 For 循環,其中每個循環在窗口中創建不同的選項卡當然,設計 UI 的方法有很多種。 但對於四級層次結構,我會考慮使用帶有“條件”選項的本地數據過濾器:
// Conditional (hierarchical) local data filter
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = dt << Graph Builder(
Size( 529, 563 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 5 ) ) ),
Local Data Filter(
Conditional,
Add Filter(
columns( :sex, :age, :name ),
Display( :sex, Size( 149, 28 ), List Display ),
Display( :age, Size( 149, 84 ), List Display ),
Display( :name, Size( 149, 210 ), List Display )
)
)
);回复:選項卡框中的 For 循環,其中每個循環在窗口中創建不同的選項卡
-->
Text Box( tabListFirst[i] ||"->"|| tabListSecond[ii][iii] ||"->"|| tabListThird[ii][iii] ||"->"|| tabListForth[iii][iiii]) )
Text Box( tabListFirst[i] ||"->"|| tabListSecond[i][ii] ||"->"|| tabListThird[ii][iii] ||"->"|| tabListForth[iii][iiii]) )
小更新……
回复:選項卡框中的 For 循環,其中每個循環在窗口中創建不同的選項卡4 級選項卡框示例:
Names Default To Here( 1 );
// Make multiple lists that will define the multi-level hierarchical tab structure
nFirst = 5;
nSecondMax = 5;
nThirdMax = 5;
nForthMax = 5;
tabListFirst = {}; // first lists
tabListSecond = {}; // second lists
tabListThird = {}; // third lists
tabListForth = {}; // forth lists
For( i = 1, i <= nFirst, i++, //first level
Insert Into( tabListFirst, " L1 Tab " || Char( i ) );
secondList = {};
For( ii = 1, ii <= nSecondMax, ii++, //second level
Insert Into( secondList, "L2 Tab " || Char( ii ) );
thirdList = {};
For( iii = 1, iii <= nThirdMax, iii++,//third level
Insert Into( thirdList, "L3 Tab " || Char( iii ) );
forthList = {};
For( iiii = 1, iiii <= nForthMax, iiii++,//forth level
Insert Into( forthList, "L4 Tab " || Char( iiii ) )
);
Insert Into( tabListForth, Eval List( List( forthList ) ) );
);
Insert Into( tabListThird, Eval List( List( ThirdList ) ) );
);
Insert Into( tabListSecond, Eval List( List( secondList ) ) );
);
/*
Show( tabListFirst );
Show( tabListSecond );
Show( tabListThird );
Show( tabListForth );
*/
// Use these lists to build the UI
tb = Tab Box(); //first level of Tab Box
For( i = 1, i <= N Items( tabListFirst ), i++,
tb2 = Tab Box(); //second level of Tab Box
For( ii = 1, ii <= N Items( tabListSecond[i] ), ii++,
tb3 = Tab Box(); //third level of Tab Box
For (iii = 1, iii <= NItems ( tabListThird[ii]), iii++,
tb4 = Tab Box();
For (iiii = 1, iiii <= NItems ( tabListForth[iii]), iiii++,
tb4 << Add( tabListForth[iii][iiii] || " Tab",
Text Box( tabListFirst[i] ||"->"|| tabListSecond[ii][iii] ||"->"|| tabListThird[ii][iii] ||"->"|| tabListForth[iii][iiii]) )
);
tb3 << Add(tabListThird[ii][iii] || " Tab", tb4);
);
tb2 << Add ( tabListSecond[i][ii] || " Tab", tb3);
);
tb << Add( tabListFirst[i] || " Tab", tb2 );
);
New Window( "Example", tb );
回复:選項卡框中的 For 循環,其中每個循環在窗口中創建不同的選項卡謝謝,這正是我正在尋找的,我的數據有 4 級,下一級的選項卡數量基於上一級的選項卡值。回复:選項卡框中的 For 循環,其中每個循環在窗口中創建不同的選項卡以吉姆的例子為基礎:
NamesDefaultToHere(1);
// Make two lists that will define the two-level hierarchical tab structure
nFirst = 4;
nSecondMax = 5;
tabListFirst = {}; // A List
tabListSecond = {}; // A list of lists
for(i=1, i<=nFirst, i++,
InsertInto(tabListFirst, "Tab "|| Char(i));
secondList = {};
for(ii=1, ii<=randomInteger(1, nSecondMax), ii++,
InsertInto(secondList, "Tab "|| Char(ii))
);
InsertInto(tabListSecond, evalList(List(secondList)));
);
// Use these lists to build the UI
tb = Tab Box();
For( i = 1, i <= N Items( tabListFirst ), i++,
tb2 = TabBox();
for(ii = 1, ii <= NItems(tabListSecond[i]), ii++,
tb2 << add(
tabListSecond[i][ii] || " Tab",
Button Box( "Press " || tabListSecond[i][ii] )
);
);
tb << Add(tabListFirst[i] || " Tab", tb2);
);
New Window( "Example", tb );回复:選項卡框中的 For 循環,其中每個循環在窗口中創建不同的選項卡是否可以動態創建第二層選項卡框,我的數據有多層數據,謝謝。
<SPAN class="token function">Names Default To Here</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token number">1</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
tabList <SPAN class="token operator">=</SPAN> <SPAN class="token punctuation">{</SPAN><SPAN class="token string">"First"</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token string">"Second"</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token string">"Third"</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token string">"Fourth"</SPAN><SPAN class="token punctuation">}</SPAN><SPAN class="token punctuation">;<BR /></SPAN>
<SPAN class="token function">New Window</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token string">"Example"</SPAN><SPAN class="token punctuation">,</SPAN> tb <SPAN class="token operator">=</SPAN> <SPAN class="token function">Tab Box</SPAN><SPAN class="token punctuation">(</SPAN><SPAN class="token punctuation">)</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
<SPAN class="token function">For</SPAN><SPAN class="token punctuation">(</SPAN> i <SPAN class="token operator">=</SPAN> <SPAN class="token number">1</SPAN><SPAN class="token punctuation">,</SPAN> i <SPAN class="token operator"><=</SPAN> <SPAN class="token function">N Items</SPAN><SPAN class="token punctuation">(</SPAN> tabList <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">,</SPAN> i<SPAN class="token operator">++</SPAN><SPAN class="token punctuation">,</SPAN>
tb <SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN><SPAN class="token messages"> Add</SPAN><SPAN class="token punctuation">(</SPAN>
tabList<SPAN class="token punctuation">[</SPAN>i<SPAN class="token punctuation">]</SPAN> <SPAN class="token operator">||</SPAN> <SPAN class="token string">" Tab"</SPAN><SPAN class="token punctuation">,<BR /></SPAN> //another layer of tabs goes here<BR />
<SPAN class="token function">Button Box</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token string">"Press "</SPAN> <SPAN class="token operator">||</SPAN> tabList<SPAN class="token punctuation">[</SPAN>i<SPAN class="token punctuation">]</SPAN> <SPAN class="token punctuation">)</SPAN>
<SPAN class="token punctuation">)</SPAN>
<SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
回复:選項卡框中的 For 循環,其中每個循環在窗口中創建不同的選項卡我之前的帖子並不是完全硬連線的。它展示了一種硬編碼方法,以及一種允許您決定在需要時添加選項卡的方法。但為了使其更直接,這裡有一個重新設計的腳本,它使用 JSL 列表來確定需要添加的選項卡
Names Default To Here( 1 );
tabList = {"First", "Second", "Third", "Fourth"};
New Window( "Example", tb = Tab Box() );
For( i = 1, i <= N Items( tabList ), i++,
tb << Add(
tabList[i] || " Tab",
Button Box( "Press " || tabList[i] )
)
);回复:選項卡框中的 For 循環,其中每個循環在窗口中創建不同的選項卡@tx尼爾森,我的代碼是我嘗試基於變量列表創建一個循環,以使列表中的每個離散項成為其自己的選項卡。您給出的示例看起來像是一種對特定數量的選項卡進行硬編碼的方法,但在我的情況下,選項卡的數量會發生變化。例如,如果有一天我的數據集列表中有 5 個不同的實體,那麼我的代碼應該生成 5 個選項卡,每個選項卡對應一個實體。但第二天我的數據集可能是 8 個實體。
還有一個不相關的問題,我知道如何更新我帳戶上的電子郵件地址嗎?我意識到我的帳戶與一個我無法再訪問的地址綁定,而且我一生都不知道如何更新它。
回复:選項卡框中的 For 循環,其中每個循環在窗口中創建不同的選項卡您用於創建新選項卡的語法不正確;下面是直接取自腳本索引的示例,介紹如何添加新選項卡。事實上,該示例展示了兩種實現此目的的方法。您的代碼僅生成一個選項卡。
Names Default To Here( 1 );
New Window( "Example",
tb = Tab Box(
Tab Page Box(
"First Tab",
Tip( "First Tab Tooltip" ),
Button Box( "Press One" )
),
Tab Page Box(
"Second Tab",
Closeable( 1 ),
Button Box( "Press Two" )
),
Tab Page Box(
"Third Tab",
Icon( "Nominal" ),
Button Box( "Press Three" )
)
)
);
Wait( 1 );
tb << Add(
"Fourth Tab",
Button Box( "Press Four" )
);