如何显示要求用户输入的文本框?你好,
我正在尝试创建一个分析我的数据的基本脚本。
当我按下链接到脚本的缩略图时,我希望它
1. 要求用户输入范围
2. 创建一个显示最大值和最小值的数据表
3. 生成一个图表,其中包含最小值、最大值和目标。
到目前为止,我所能做的就是获取数据表或图形的脚本,并将其单独合并到 JMP 中的快捷方式中。 我不知道如何让它为用户生成查询框,并且我无法将图形和数据表合并在一起。 您能否建议一个可能对此有所帮助的基本教程集?
亲切的问候,
埃莱娜
回复:如何显示一个文本框,要求用户输入。嗨,贾莫,
再次感谢! 还有一个问题:为什么我的脚本在使用 userFirstName 和 userLastName 时可以工作,但在定义文件路径字符串文本中使用 b1,b2 时却不起作用:
// Defining firstname and lastname string
userFirstName = "XXXX";
userLastName = "YYYY";
//changing username variables based on user input
w = New Window( "Defining User Name", <<MODAL></MODAL>
最好的,
晚的
回复:如何显示一个文本框,要求用户输入。您收到此错误是因为您正在使用模态窗口并且“太早”关闭它。 模态窗口是特殊类型的窗口,基本上要求您使用特定的按钮标题脚本编写指南 > 显示树 > JSL 中的模态窗口 > 构造模态窗口
笔记:模态窗口至少需要一个按钮来关闭窗口。 您可以使用好的,是的,不, 或者取消为模态窗口按钮添加标签。 如果您在模式窗口中至少不包含这些按钮之一,JMP 会添加一个好的按钮。
删除 w << closeWindow;从您的更新字符串按钮。 如果您希望在按下该按钮时关闭窗口(您将有不必要的“确定”按钮),请添加“确定”按钮,然后向其发送单击消息。 我想如果你愿意的话你甚至可以隐藏“确定”按钮
Names Default To Here(1);
// Defining firstname and lastname string
userFirstName = "XXXX";
userLastName = "YYYY";
//changing username variables based on user input
w = New Window("prototype",
<<MODAL></MODAL>
回复:如何显示一个文本框,要求用户输入。嗨,贾莫,
谢谢你! 这真是一种享受! 然而,我现在遇到了另外两个问题。 如果我可以描述一下它们的话:
// Defining firstname and lastname string
userFirstName = "XXXX";
userLastName = "YYYY";
//changing username variables based on user input
w = New Window( "prototype", <<MODAL></MODAL>
首先,按更新字符串确实会输出正确的表,但也会引发错误:

其次,如果我使用变量 userFirstName 和 userLastName,脚本“有效”,即执行多个文件导入,但如果我在连接字符串中使用 b1、b2,则该脚本不起作用。 我的猜测是,我用来定义 b1、b2 变量(使用文本编辑框)的部分是本地的。 b1,b2 变量不会继续存在于剩余的脚本中吗? 如果是这种情况,我该如何使它们作为全局变量存在。
我该如何消除错误? 这似乎是由我向窗口添加 << 模态子句引起的。 但我需要这样做才能暂停脚本并允许操作员检查他们的姓名输入是否正确。
理想情况下,我尝试构建的工作流程是:
用户运行脚本
该脚本会弹出一个弹出框,要求用户定义他们的名字和姓氏
该脚本允许用户检查他们的输入是否正确(显示 filePathString 会比当前输出更好)
用户单击“确定”后,该脚本将继续,并在几个不同的 filePathString 中使用新变量。
为了实现我的目的,我可以通过许多其他方法将数据输入文本框合并到此脚本中,因此我们将不胜感激。
谢谢,
晚的
回复:如何显示一个文本框,要求用户输入。您将 Send 发送到那里,因为它是正在“评估”到表中的内容(<< 表示发送() )很可能只需用 Eval List() 包装列表来评估其中的值就足够了
Names Default To Here(1);
// Defining firstname and lastname string
userFirstName = "XXXX";
userLastName = "YYYY";
//changing username variables based on user input
w = New Window("prototype", // 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("First Name: "), b1 = Text Edit Box(userFirstName)), // data entry
Spacer Box(size(1, 10)), // a little vertical space
H List Box(Text Box("Last Name: "), b2 = Text Edit Box(userLastName)), // more data entry
Spacer Box(size(1, 30)), // a little vertical space
H Center Box( // center the button
Button Box("Update Strings", // this script runs when the button is pressed...
// make a new table with the values...
dt = New Table("StringCheck",
New Column("Name",
Character,
Set Values(Eval List({b1 << get text(), b2 << get text()}))
)
);
// optionally, close the dialog. Or, you might want to run it again...
w << closeWindow; // just the dialog, not the report
)
)
)
)
);
回复:如何显示一个文本框,要求用户输入。嗨克雷格,
我希望回复旧线程没问题。 我想创建一些变量,以便稍后在脚本中用作字符串(用于文件导入的用户目录,该目录根据用户而变化) - 我正在尝试调整您的脚本来实现此目的。
这个想法是首先使用默认值创建变量。 然后输入框出现,用户更改值,脚本继续并在导入中使用现在更新的变量。
//Import multiple files
Multiple File Import(
<<SET folder=""></SET>
所以下面将在脚本中首先出现:
// Defining firstname and lastname string
userFirstName = "XXXX";
userLastName = "YYYY";
//changing username variables based on user input
w = New Window( "prototype", // 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( "First Name: " ), b1=Text Edit Box( userFirstName ) ), // data entry
Spacer Box( size( 1, 10 ) ), // a little vertical space
H List Box( Text Box( "Last Name: " ), b2=Text Edit Box( userLastName ) ), // more data entry
Spacer Box( size( 1, 30 ) ), // a little vertical space
H Center Box( // center the button
Button Box( "Update Strings", // this script runs when the button is pressed...
// make a new table with the values...
dt = New Table( "StringCheck", New Column( "Name", Character, Set Values( {b1<< get text(), b2 << get text()} ) ) );
// optionally, close the dialog. Or, you might want to run it again...
w << closeWindow; // just the dialog, not the report
)
)
)
)
);我成功获得了数据输入窗口和一个名为 StringCheck 的表,其中包含字符列“Name” - 但是这两个值是“Send”:

我尝试了一些不同的方法来让它发挥作用,但我一生都无法弄清楚“发送”是从哪里来的。
任何帮助表示赞赏,谢谢,
晚的
回复:如何显示一个文本框,要求用户输入。嗯。 我想知道我是否测试了 JSL。 当字段更改时,NumberEditBox 不会更新 v1/v2 变量,因此报告始终相同。 这应该是这样的:
v1 = 30; // two numbers with default
v2 = 40; // values; these will go in a data table
w = New Window( "prototype", // 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( "value 1: " ), b1=Number Edit Box( v1 ) ), // data entry
Spacer Box( size( 1, 10 ) ), // a little vertical space
H List Box( Text Box( "value 2: " ), b2=Number Edit Box( v2 ) ), // more data entry
Spacer Box( size( 1, 30 ) ), // a little vertical space
H Center Box( // center the button
Button Box( "make report", // this script runs when the button is pressed...
// make a new table with the values...
dt = New Table( "Untitled", New Column( "a", Set Values( {b1<<GET></GET>
使用额外的 b1 和 b2 变量来记住这些框,以及发送到这些框的 <
The report isn't created until after the button is pressed. Artistic license.The report isn't created until after the button is pressed. Artistic license.The report isn't created until after the button is pressed. Artistic license.The report isn't created until after the button is pressed. Artistic license.The report isn't created until after the button is pressed. Artistic license.The report isn't created until after the button is pressed. Artistic license.The report isn't created until after the button is pressed. Artistic license.The report isn't created until after the button is pressed. Artistic license.The report isn't created until after the button is pressed. Artistic license.The report isn't created until after the button is pressed. Artistic license.按下按钮后才会创建报告。 艺术许可。
回复:如何显示一个文本框,要求用户输入。该线程似乎还有另一个实例这里。 另请参阅我在那里发布的回复。
回复:如何显示一个文本框,要求用户输入。您可以使用自定义提示在 JMP 中创建模态或非模态对话框。
模态对话框不会让您执行任何其他操作,直到您完成它们。 http://www.jmp.com/support/help/Modal_Windows.shtml
非模式对话框允许您在其他窗口中工作并稍后返回到非模式窗口: http://www.jmp.com/support/help/Constructing_Display_Trees.shtml#259363
您所描述的非模态原型可能如下所示:
v1 = 30; // two numbers with default
v2 = 40; // values; these will go in a data table
w = New Window( "prototype", // 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( "value 1: " ), Number Edit Box( v1 ) ), // data entry
Spacer Box( size( 1, 10 ) ), // a little vertical space
H List Box( Text Box( "value 2: " ), Number Edit Box( v2 ) ), // more data entry
Spacer Box( size( 1, 30 ) ), // a little vertical space
H Center Box( // center the button
Button Box( "make report", // this script runs when the button is pressed...
// make a new table with the values...
dt = New Table( "Untitled", New Column( "a", Set Values( {v1, v2} ) ) );
// launch a platform to analyze the data...
dt << Distribution( Continuous Distribution( Column( :a ), Quantiles( 0 ), Summary Statistics( 0 ), Vertical( 0 ), Outlier Box Plot( 0 ) ) );
// optionally, close the dialog. Or, you might want to run it again...
w << closeWindow; // just the dialog, not the report
)
)
)
)
);
Prototype dialogPrototype dialogPrototype dialogPrototype dialogPrototype dialogPrototype dialogPrototype dialogPrototype dialogPrototype dialogPrototype dialog原型对话框
回复:如何显示一个文本框,要求用户输入。b1 和 b2 不存储值,它们只是对显示框的引用。 当您关闭模态窗口时,您将失去对这些窗口的访问权限。 您可以在按下按钮时存储值
Names Default To Here(1);
// Defining firstname and lastname string
userFirstName = "XXXX";
userLastName = "YYYY";
//changing username variables based on user input
w = New Window("Defining User Name",
<<MODAL></MODAL>
b1_val 和 b2_val。 如果您使用类似的东西,那么在向表中添加值时也应该使用它们