JSL:根據用戶通過彈出窗口輸入定義變量你好,
我想創建一個彈出窗口,允許用戶定義變量而無需訪問代碼。 我設法彈出窗口以根據以前的帖子獲取用戶條目,但無法將其傳遞給變量。
你能幫我解決這個問題嗎?
先感謝您
// Indicate here the name of the input HTML table
input_table = "http://xxx.html";
// Indicate here the name you want for your JMP data table
JMP_table_name = "JMP data table";
w = New Window( "User inputs", // opens a window with a title and this content...
Border Box( top( 20 ), bottom( 20 ), Left( 20 ), Right( 20 ), // window dressing
V List Box( // V and H lists nest to organize the display boxes
H Center Box( Text Box( "Report Generator" ) ), // a second title, centered
Spacer Box( size( 1, 30 ) ), // a little vertical space
H List Box( Text Box( "input_table: " ), input_table=Text Edit Box("http://xxx.html") ), // data entry
Spacer Box( size( 1, 30 ) ), // a little vertical space
H List Box( Text Box( "JMP_table_name: " ), JMP_table_name=Text Edit Box("JMP data table") ), // more data entry
Spacer Box( size( 1, 30 ) ), // a little vertical space
H Center Box( // center the button
Button Box( "Submit", // this script runs when the button is pressed...
input_table = result["input_table"];
JMP_table_name = result["JMP_table_name"];
w << closeWindow; // close the dialog
)
)
)
)
);高級統計建模數據存取回复:JSL:根據用戶通過彈出窗口輸入的內容定義變量我找到了解決方案。 我使用“文本編輯框”和“獲取文本”作為數值。 我修改為“數字編輯框”和“獲取”並且它有效。:
// Initialize variables with default values
// Number of input data tables (default = 1)
nb_join_tables = 2;
//links to the input HTML tables
input_table_01 = "http://xxx.html";
input_table_02 = "http://xxx.html";
//Create a pop up window to request user inputs for the variables
w = New Window( "User inputs", <<MODAL></MODAL>
回复:JSL:根據用戶通過彈出窗口輸入的內容定義變量你好,
我跳進了另一個問題。
我設法打開模式窗口,並在腳本中傳遞了 input_table 和 JMP_table 名稱的新變量定義。
繼續查看變量,我發現它已正確更新。
然後,我的腳本的其餘部分應該執行操作,例如打開用戶指定的表(在按鈕之外),但它不會運行。
我嘗試將整個腳本放入模式窗口中,我還嘗試添加 wait() 但這沒有幫助。
如果我在沒有模式窗口的情況下運行腳本,它可以正常工作,所以問題肯定來自那裡。
知道如何解決這個問題嗎?
這是代碼。
// Initialize variables with default values
// Number of input data tables (default = 1)
nb_join_tables = 2;
//links to the input HTML tables
input_table_01 = "http://xxx.html";
input_table_02 = "http://xxx.html";
//Create a pop up window to request user inputs for the variables
w = New Window( "User inputs", <<MODAL></MODAL>
回复:JSL:根據用戶通過彈出窗口輸入的內容定義變量太感謝了!
也感謝您解釋我所犯的錯誤;這肯定會幫助我將來度過難關。
祝你有美好的一天!
回复:JSL:根據用戶通過彈出窗口輸入的內容定義變量您的腳本有幾個問題。第一個,您正在更改 Input_table 和 JMP_table_name 變量的數據類型。您首先將其定義為字符串,然後將它們重新定義為顯示字段。
其次,僅僅因為JMP正在打開一個窗口,並不會停止JSL處理,並等待用戶輸入。JMP 將繼續處理,除非窗口被定義為模態窗口 請參閱下面我對腳本的修改。我強烈建議您花時間閱讀腳本指南。
// Indicate here the name of the input HTML table
input_table = "http://xxx.html";
// Indicate here the name you want for your JMP data table
JMP_table_name = "JMP data table";
w = New Window( "User inputs", <<MODAL></MODAL>