嗨,伙计们,jmp 脚本的新手。我附上了一个脚本,它是在 2012 年编写的,自从迁移到 jmp16 后现在无法运行,它在 jmp14 下工作。它基本上允许我读取所有列参数的规格上限和下限。 以下是我读入后的错误消息和我的数据文件的示例。任何帮助将不胜感激。我没有写剧本,那个人已经离开了公司。
提前感谢您的任何帮助。


有2个问题。
- 变量“版本”的值尚未设置。
- 在 JMP 16 中,代码在遇到字符变量时停止。
我解决了这两个问题。我实际上并没有检查字符的数据类型,而是检查以确保建模类型是连续的。名义或有序数字列也不应设置规格限。
Names Default To Here( 1 );
version = JMP Version();
/*** This script will save the values in the specified rows as ***/
/*** Spec Limit column attributes for each respective column. ***/
/*** If there is no value for a particular column, the Spec ***/
/*** Limit attribute for that column will not be changed. By ***/
/*** saving the limits as column attributes, the Cpk analysis ***/
/*** along with limits reference markers, will automatically ***/
/*** be generated whenever a distribution is generated for a ***/
/*** column. ***/
/*** Alternatively, this script can be used to delete the ***/
/*** Spec Limits column attributes altogether by checking the ***/
/*** "Delete Attributes" checkbox. ***/
// 10/28/2004 v2.0
// 12/24/2012 v2.1, modified to handle limits with units, like "2 Ohms"
Limits_dlg = Dialog(
Text Box( Version ),
Text Box( " " ),
Text Box( " " ),
Text Box( " " ),
Text Box( "Spec Limits:" ),
Text Box( " " ),
LineUp( 2,
"LSL is in row", LSLRow = EditNumber( 1 ),
"USL is in row", USLRow = EditNumber( 2 )
),
Text Box( " " ),
Text Box( " " ),
Text Box( " " ),
Text Box( "My table already has Spec Limits attributes, and I want to delete them... " ),
DelAttr = Check Box( "Delete Attributes", 0 ),
Text Box( " " ),
HList( Button( "OK" ), Button( "Cancel" ) )
);
If( Limits_dlg["Button"] == -1,
Throw( "!User Cancelled" )
);
If( Limits_dlg["DelAttr"] == 1,
For( i = 1, i < N Col() + 1, i++,
Column( i ) << Delete Property( "Spec Limits" )
),
//Else...
For( i = 1, i < N Col() + 1, i++,
If( As Column( i ) << get modeling type == "Continuous",
LSpec = Column( i )[Limits_dlg["LSLRow"]];
LSpec = Num( Word( 1, Char( LSpec ) ) ); //Truncate to numeric if it has units appended to it.
USpec = Column( i )[Limits_dlg["USLRow"]];
USpec = Num( Word( 1, Char( USpec ) ) ); //Truncate to numeric if it has units appended to it.
Eval(
Substitute(
Expr(
Column( i ) << Set Property(
"Spec Limits",
{LSL( _LSL ), USL( _USL ), show limits( 1 )}
)
),
Expr( _LSL ), LSpec,
Expr( _USL ), USpec
)
);
)
)
);
谢谢德克萨斯,
还是一样的错误信息。我相信您只添加了两行,没有其他更改?
我注意到我错过了 org 文件中的原始行。
版本 =“作为属性的限制,v2.1 2012 年 12 月 24 日”;
以上在原始文件中,不确定这是否会改变您提出的解决方案。
当我查看 Version 的值时,它肯定会显示 16 女巫是我正在运行的。当我尝试观看 Names Default to Here 时它挂断了?
名称默认在此处 (1);
版本 = JMP 版本 ();
谢谢
Names Default to Here() 没有什么可看的。它只是设置默认范围。如果您的代码位于一段较大代码的中间,则应将 Names Default to Here() 移至 JSL 的第一行,如果这不起作用,则完全删除该行。我还添加了一个新的 If() 子句,如果该列不是数字连续列,则不处理规格限制。
去除那个
Version = JMPVersion();
并使用你的
Version = "Limits as Attributes, v2.1 December 24, 2012";