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:通过弹出窗口根据用户输入定义变量您的脚本有几个问题。第一个,您正在更改 Input_table 和 JMP_table_name 变量的数据类型。您首先将 then 定义为字符串,然后将它们重新定义为 Display 字段。
其次,只是因为 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>
回复:JSL:通过弹出窗口根据用户输入定义变量非常感谢!
也感谢您解释我所犯的错误;这肯定会帮助我在未来度过难关。
祝你有美好的一天!
回复: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:通过弹出窗口根据用户输入定义变量我找到了解决方案。 我使用“文本编辑框”和“获取文本”作为数值。 我修改为“数字编辑框”和“获取”,它可以工作。:
// 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>