How to execute a portion of a script based on USER selection on a pop out boxHi, I have a really basic question: I am running the following script but I want to have a user interface that allows the user to select an option. Based on the option that is selected, a portion of the script is run. Can you kindly help with that or refer to an example which I can use in my script.
Below is the not the complete script, it is just to highlight that the script has multiple portions, some are just Overlay plots and some summaries or joining. I want to know how to can I execute portion of a script if a specific option is selected by the user and how to end this if user cancels or clicks on "x" on the pop-up window.
//***********
overlayPlot = {"ByTestHead","ByDuts","EntireFleetOn1Dut" };
Options = new window("Overlay Plot",<<MODAL></MODAL>
Re: How to execute a portion of a script based on USER selection on a pop out boxHere is a very simple example using a Radio Box. Depending upon the user selection values are added to a table.
The <
"this" refers to the display box object. Sending a message to "this" must be a valid message for a radio box.
It is likely that your example is a menu of options. You can add buttons and items to a JMP platform window.
Names Default To Here( 1 );
testTable = new Table("get values", New Column("User Selections", numeric));
New Window( "Example",
Radio Box({"press one", "press two", "press 3"},
<<SETFUNCTION></SETFUNCTION>The dialog box persists, but it is not modal, meaning it does not lock out other JMP actions while it is open.
I hope you find this example informative.
Re: How to execute a portion of a script based on USER selection on a pop out boxI have a follow-up question.
Now what I want is the option box to remain open even after making a selection so that I can make another choice if I want to.
How can I script it in shuch a way that dialog box closes only when I cancel?
Re: How to execute a portion of a script based on USER selection on a pop out boxthanks a lot Guys. Both were very helpful.
Re: How to execute a portion of a script based on USER selection on a pop out boxYou might want to look at this blogpost: https://community.jmp.com/t5/JMPer-Cable/How-to-create-a-JMP-user-interface-using-display-boxes-in-JSL/ba-p/44034
Much more info about user interfaces in JMP is of course provided in the JMP Scripting Guide (in JMP go to the main menu => Help => Books => Scripting Guide). You will be interested in chapter 11 "Display Trees".
Here is a very simple example in JSL:
// User Interface using radio buttons
ui = New Window( "Chose an option",
<<MODAL></MODAL>
Re: How to execute a portion of a script based on USER selection on a pop out boxHi. I have a simple recommendation: use expressions to store portions of your script.
Expressions can be entire scripts. Another option is to use Include() files.
You did not say which version of JMP you are using. I attached two scripts, one for version 12 and another for version 13, that selects different expressions. The one for version 12 might also work on version 11.
These scripts prompt the user and runs different expressions based upon user input or cancel. The Expressions are simple caption boxes.
Hope this helps.