概述
使用 JMP ®脚本语言 (JSL) 编写列属性脚本时,重要的是要了解列只是所有列属性的存储库。列存储列属性及其提供的值,而无需评估或验证提供的参数。为了使用包含变量的 JSL 代码添加列属性,脚本必须将所有变量转换为其实际值。
一种方法是使用表达式。在下面的示例中,Eval Expr() 函数计算并替换 Expr() 函数中包装的任何变量,并将其替换为其值。外部 Eval() 函数在替换完成后计算整个语句的值。
指示
在 JMP 会话中,单击文件菜单并选择新建 ► 脚本。复制以下脚本并将其粘贴到脚本窗口中。要运行示例脚本,请单击编辑菜单并选择运行脚本。
/* Open a sample data table */
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
/* Assign desired spec limits */
lLimit = 55;
uLimit = 70;
tLimit = 62.5;
/* Store the limits in the Spec Limits column property */
Eval( //Evaluates the entire expression after the replacement has occurred
Eval Expr( //Evaluates and replaces any variable wrapped in the Expr() function with its value
:height << Set Property(
"Spec Limits",
{LSL( Expr( lLimit ) ), USL( Expr( uLimit ) ), Target( Expr( tLimit ) ), Show Limits( 0 )}
)
)
);
其他文档
有关 JMP 脚本语言的更多信息,请参阅JMP 脚本指南您可以在 JMP 中点击帮助菜单并选择JMP 帮助。从在线目录中选择脚本指南.
[先前的 JMP 说明 46953]
我该如何提示用户输入 lLimit、uLimit 和 tLimit?