获取批处理/交互模式我想知道是否有办法在本地抑制模态窗口。批量交互似乎没有。
Names default to here(1);
batch interactive(1);
new window("Test", <<MODAL></MODAL>
所以我想知道是否有办法获得当前的批处理交互模式,这样我就可以做这样的事情。
Names default to here(1);
batch interactive(1);
if(batch interactive(), // or some other internal variable
print("YAY")
, // else
new window("Test", <<MODAL></MODAL>
显然我可以创建自己的批处理变量,但我想知道是否有内置的东西。
回复:获取批处理/交互模式谢谢(你的)信息。
在 JMP 支持的帮助下: )
batch interactive(boolean) returns the previous setting.
Names default to here(1);
//works for both options
//batch interactive(0);
//batch interactive(1);
last setting = batch interactive(1); // return value is last setting
batch interactive(last setting); // reset it in case we set it erroneously
if(last setting,
print("YAY")
, // else
new window("Test", <<MODAL> </MODAL>
回复:获取批处理/交互模式我的总是从 1 开始,这让我认为 JMP 是批量执行的。但事实并非如此。启动时第一次返回的是 0 吗?
回复:获取批处理/交互模式好点子 ...
当我们运行脚本时,JMP 似乎会自动启动,并且默认将“批处理交互”设置为 1
- 这样就不会出现任何警告消息并且不会干扰脚本。
但事实绝对不是如此。
也许有不同种类的“警告”? - 其中一些忽略了这个默认的“批量交互”~1 设置,因此需要通过 JSL 发送明确的批量交互(1)来“闭嘴”?
类似于Eval(arg)与Eval(Eval Expr( .... Expr(arg) ...):
JMP 平台和函数的一部分只需要围绕参数进行 Eval()来修复变量引用问题。
对于另一部分, Eval(arg)方法将失败,用户必须回退到Eval(Eval Expr( .... Expr(arg) ... )。
... 找出哪个函数属于哪个组是 JSL 脚本编写者和 JMP 支持人员的日常乐趣。
回复:获取批处理/交互模式批量交互的不同行为以及不同的“默认”模式的示例:
Names Default To Here( 1 );
testMarkup = Function( {},
text = Text Box("Bad XML <");
text << markup;
);
// Run the next four lines individually
testMarkup(); // no special setting: default
batch interactive(1);testMarkup(); // batch interactive is turned "on" so we see an error
batch interactive(0);testMarkup(); // batch interactive is turned off so we can show an error
new window("test",buttonbox("Test", testMarkup())); // running jsl in response to a click is not batch interactive mode
new window("test",buttonbox("Test", batch interactive(1);testMarkup())); // set batch interactive to 1 so the error message goes to the log and there is no modal dialog
// the findings:
// default -> no dialog
// 1 -> no dialog
// 0 -> dialog
// Run the next 3 lines individually to check if formula errors behave the same as above
:col1 << remove formula(); // no special setting: default
batch interactive(1);:col1 << remove formula(); // batch interactive is turned "on"" so we see an error
batch interactive(0);:col1 << remove formula(); // batch interactive is turned off so we can show an error
// the findings:
// default -> dialog (!!!!!)
// 1 -> no dialog
// 0 -> dialog从 JMP 支持处,我获得了以下信息:
Batch Interactive()函数尚未记录。其行为可能因情况而异,并且将来可能会发生变化。实际上,它可以被视为实验性的且不受支持。