獲取批處理/交互模式我想知道是否有辦法在本地抑制模態窗口。批量交互似乎沒有。
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會自動啟動,預設將“ Batch Interactive ”設為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()函數未記錄。在不同的情況下,行為可能會有所不同,並且將來也可能會發生變化。實際上,它可以被認為是實驗性的並且不受支援。