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" )
);