卡在模态上大家好,
我希望有人可以帮助我使用 Modal,之前我在我的 JMP 脚本中计算 FV,如下所示:
Finalivc2 << New Column( "Runs", Numeric, Continuous );
:Runs<<SET each="" value=""></SET>
效果很好,尽管有时我会忘记更新 :Runs 和 :Replicates per run 参数,这让我有些难过,我决定使用模态来自动化这个过程,如下所示
FV_param = New Window ("Format Variability Parameters", << Modal, << Return Result,
Text Box ("Select Format Variability Parameters"),//Create the display box
HListBox(
LineupBox (NCol (2),
Text Box ("Runs NOT REPLICATES"), Runs = numberEditBox(2),
Text Box ("Replicates NOT RUNS"), Replicates per Run = numberEditBox(1),
), // end of lineupbox
LineupBox ( NCol (1), ButtonBox ("OK"), ButtonBox ("Cancel"))
) // end HListBox
);
show (FV_param, FV_param ["Runs"], FV_param ["Replicates per Run"],
FV_param ["Button"] );
If (FV_param ["Button"] == -1,
Caption (" Wait...Aborting..."); Wait (3) ; Caption(Remove); Throw());
StatusMsg ("Processing next steps");
RemoveFrom (FV_param, NItems(FV_param)); // Removes the last item "Button 1" from the assignment list
Eval List(FV_param); // the assignment from the display box
Eval(
Substitute(
Expr( Finalivc2 = New Column( "Runs", Numeric, "Continuous", Format( "Best", 12 ),
Expr( Finalivc2 = New Column( "Replicates per Run", Numeric, "Continuous", Format( "Best", 12 ),
)
),
Expr( __FV_param__ ), Runs, Replicates per Run
)
)));
Finalivc2 << New Column( "Format Variability %GCV", Numeric, Continuous, Formula( ((2^root(((:IR)/(:Runs)+(:Residual)/(:Replicates per Run*:Runs)),2))-1)*100 ), Format( "fixed dec", 4, 1 ) );我毫不怀疑我的评估和替换不正确,我没有在表格中得到变量运行和每次运行的 Relicates,然后它没有进行计算,任何人都可以提供一些帮助
谢谢
回复:卡在模态上嗨,pmroz,
非常感谢您的回复,我接受了昨天的 Craige 帖子作为解决方案,我错过了昨天的编码。
问候,
米奇男孩。
回复:卡在模态上嗨,格雷格,
您昨天的解决方案是正确的,我错过了编码,我使用了
dt<< 新列而不是 finalivc2<
| 运行 | 每次运行的重复次数 | 格式可变性 %GCV |
| 2 | 1 | 26.1 |
| 2 | 1 | 25.9 |
| 2 | 1 | 29 |
| 2 | 1 | 28.4 |
| 2 | 1 | 29 |
| 2 | 1 | 29.6 |
| 2 | 1 | 28.4 |
| 2 | 1 | 28.4 |
| 2 | 1 | 20.7 |
非常抱歉,效果很好,非常感谢您的耐心和帮助,非常感谢。
真诚的问候
米奇男孩
回复:卡在模态上我不知道该期刊是从哪里来的,也不知道为什么会这样说。 我在打开 dt 的情况下运行你的代码,我得到了这个:
columns added with values set添加了值集的列
我认为@pmroz答案不是通过 <
您的表现在是用列和值创建的吗? 也许在那之后还有另一个问题。
回复:卡在模态上您正在尝试将数字编辑框变量用作输入的值。你不能那样做;相反,您需要使用从数字编辑框中提取值<< 得到.在下面的代码中,我附加了_鼻变量:
FV_param = New Window( "Format Variability Parameters",
<<MODAL></MODAL>
回复:卡在模态上嗨克雷格,
我正在运行相同的版本 14,所以现在我的代码看起来像这样
FV_param = New Window ("Format Variability Parameters", << Modal, << Return Result,
Text Box ("Select Format Variability Parameters"),//Create the display box
HListBox(
LineupBox (NCol (2),
Text Box ("Runs NOT REPLICATES"), Runs = numberEditBox(2),
Text Box ("Replicates NOT RUNS"), Replicates per Run = numberEditBox(1),
), // end of lineupbox
LineupBox ( NCol (1), ButtonBox ("OK"), ButtonBox ("Cancel"))
) // end HListBox
);
show (FV_param, FV_param ["Runs"], FV_param ["Replicates per Run"],
FV_param ["Button"] );
If (FV_param ["Button"] == -1,
Caption (" Wait...Aborting..."); Wait (3) ; Caption(Remove); Throw());
StatusMsg ("Processing next steps");
RemoveFrom (FV_param, NItems(FV_param)); // Removes the last item "Button 1" from the assignment list
Eval List(FV_param); // the assignment from the display box
dt<<NEW column=""></NEW>但它仍然不会将值设置为输入到模式框中的内容,我在日记中得到了这个:
格式可变性 %GCV
.
.
.
.
.
.
.
.
.
日志中没有发布任何值。
有任何想法吗??
谢谢你的帮助
回复:卡在模态上(您运行的是什么版本的 JMP? 我14岁...)
您不需要使用替代(...)。 尝试更换你的eval( ... 替代(... (expr(...代码类似于
dt<<NEW column=""></NEW>
在您的示例中,括号嵌套使替换(eval(...))带有一个要替换的参数。 替换需要(编辑两个->三个)三个参数。
回复:卡在模态上嗨克雷格,
有一段时间尝试根据您的建议运行脚本,但仍然没有运行,在调试中得到相同的错误,在访问替代评估时没有足够的参数。
问候
米奇男孩
回复:卡在模态上嗨克雷格,
今天已经没时间了,但会在早上尝试这个,让你知道,我遇到的问题是评估对话框中的值并将其替换为方程。
谢谢
回复:卡在模态上你的脚本的最后一点应该是这样的。 您可能还会遇到一些 JSL 变量名和列名相同的命名问题;使用 dt:Runs 或 global:Runs 可能有助于获得正确的。
dt=currentDataTable(); // you should already have a variable for your data table
dt<<NEW column=""></NEW>