你好,
我一直在创建一个应用程序,该应用程序涉及用户选择用于构建模型的列,用于选择 PQA,通过使用模态窗口,如附件 JMP 文件中的玩具数据和脚本,标题为“选择 PQA 的模型和列”。
该模型应该为为具有任何列名拼写的任何数据集选择的每个 PQA 创建自定义输出。 运行脚本时,会弹出一个弹出窗口,要求用户选择特定的列。 该窗口如下图所示:

下一个窗口要求用户设置 PQA、存储条件,并询问用户是否要查看每个 PQA 的子集数据集 - 存储条件。 也就是说,对于每个选择的 PQA,都会在后台创建一个子集数据集。 然后,生成模型和图形结果,然后在 for 循环的每次迭代中将其附加到带有自定义和格式化数据的窗口(带有 LSL 和 USL y 轴线和带有测量值的 y 轴标签)。

下面是 JSL 脚本代码,它在给定上述窗口的用户输入的情况下产生输出:
//select the data in the original data table
Names Default To Here( 1 );
dt = Current Data Table();
//get the unique PQAs
col9 = Column(dt, "PQA");
unique_pqa = Associative Array( col9 ) << get keys;
/////////////////////////////////////////////////////////////
//User Selection Menu(s)
/////////////////////////////////////////////////////////////
//Part 1: ask user for column names in a new window nw1
//possible Group column name (should be character)
character_col_names = dt << Get Column names(character, String);
//possible result column name (should be numeric)
numeric_col_names = dt << Get Column names(Numeric, String);
nw1 = New Window("Column names",
<<MODAL></MODAL>
创建输出窗口后,我希望能够将脚本保存到原始数据表中,其中包含所有数据(子集数据所依赖的数据)。 但是,当我将所有输出的脚本保存到脚本窗口时,我得到以下结果:
注意
Where ( :PQA == pqa_val & column(listDT, set_storage_condition_col) == selected_stor_cond )
语句不允许脚本工作。
我希望此脚本中的此语句具有特定的输出。 例如,在我附上的玩具数据集中,
column(listDT, set_storage_condition_col)
等于:储存情况
此外,如果我选择 A 作为pqa_val ( 以便:PQA == "A" ) 和 5C 作为selected_stor_cond (以便:储存条件 == "5C" )。
但是,即使我指的是用户输入,生成的输出脚本也不存在。 为什么 JMP 不将上述示例中的这些值写入循环中每个特定实例的脚本中?
使用 Eval Insert、Eval Expr、Parse 和 Substitute 将一个表达式插入另一个表达式应该可以帮助你。 当您使用模态窗口时,按下按钮也不需要 << 关闭窗口。
我在 where 语句周围和内部添加了一个 Eval(EvalExpr()) 和几个 Expr()。:
查看更多...
//select the data in the original data table
Names Default To Here(1);
dt = Current Data Table();
//get the unique PQAs
col9 = Column(dt, "PQA");
unique_pqa = Associative Array(col9) << get keys;
/////////////////////////////////////////////////////////////
//User Selection Menu(s)
/////////////////////////////////////////////////////////////
//Part 1: ask user for column names in a new window nw1
//possible Group column name (should be character)
character_col_names = dt << Get Column names(character, String);
//possible result column name (should be numeric)
numeric_col_names = dt << Get Column names(Numeric, String);
nw1 = New Window("Column names",
<<MODAL></MODAL>
非常感谢。 我什至没有考虑过使用 Eval() 和相关的。 我一定会阅读更多有关此内容的信息,并会查看您提供的链接。