大家好,
我遇到以下问题:我正在创建一系列标签参数概述窗口。 这些选项卡在“ 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()循环中的错误。 这就是为什么它无法显示最后一个选项卡的原因。 此致