<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Force User to Provide Input Within Range in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404456#M65491</link>
    <description>&lt;P&gt;Wouldn't it be simpler to use Radio Box for implementation like that?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
New Window("Example", rb = Radio Box({"True", "False", "None of the above"}, Print("Selection Changed")));&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 27 Jul 2021 20:41:12 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2021-07-27T20:41:12Z</dc:date>
    <item>
      <title>Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404417#M65483</link>
      <description>&lt;P&gt;Hi, I'm fairly new to JMP and I'm not sure how to write a script that throws an error to prevent the user from inputting an invalid number. I want the user to input a number that is eventually saved into a variable but re-prompt for input if the number is outside the range 1-4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I have so far without any error checking:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here (1);
num = 0;

w = New Window( "Prompt",
	&amp;lt;&amp;lt;Modal,
	&amp;lt;&amp;lt;return result,
	V List Box(
		Text Box( "Enter Number Between 1 and 4" ),
			str1 = Number Edit Box(num)
	),
);

input = w["str1"];

show(input);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any help or suggestions on accomplishing this would be appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:53:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404417#M65483</guid>
      <dc:creator>ozs02</dc:creator>
      <dc:date>2023-06-09T19:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404430#M65484</link>
      <description>&lt;P&gt;You could use set function in some way.&lt;/P&gt;&lt;P&gt;Below is an example where the value is set to 1 if user tries to input value below 1 and to 4 if user inputs above 4&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here (1);
num = 1;

w = New Window( "Prompt",
	&amp;lt;&amp;lt;Modal,
	&amp;lt;&amp;lt;return result,
	V List Box(
		Text Box( "Enter Number Between 1 and 4" ),
			str1 = Number Edit Box(num, 
				&amp;lt;&amp;lt; Set Function(Function({this},
					If(this &amp;lt;&amp;lt; get &amp;lt; 1, this &amp;lt;&amp;lt; set(1),
						this &amp;lt;&amp;lt; get &amp;gt; 4, this &amp;lt;&amp;lt; set(4)
					);
					
				))
			)
	),
);

input = w["str1"];

show(input);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 20:24:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404430#M65484</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-07-27T20:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404444#M65487</link>
      <description>&lt;P&gt;Here is a modification of your code that handles the requirement to only allow values 1-4&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
num = 0;
input = 0;
w = New Window( "Prompt",
	&amp;lt;&amp;lt;Modal,
	&amp;lt;&amp;lt;return result,
	V List Box(
		Text Box( "Enter Number Between 1 and 4" ),
		str1 = Number Edit Box(
			num,
			10,
			&amp;lt;&amp;lt;SetFunction(
				Function( {this}, /* put my value into my sibling's display */
					If( str1 &amp;lt;&amp;lt; get &amp;gt; 4 | str1 &amp;lt;&amp;lt; get &amp;lt; 1,
						str1 &amp;lt;&amp;lt; set( 0 )
					)
				)
			)
		),
		H List Box( Button Box( "Cancel" ), Button Box( "OK" ) )
	),

);

If( w["button"] == 1,
	input = w["str1"]
);

Show( input );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Jul 2021 20:29:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404444#M65487</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-07-27T20:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404454#M65489</link>
      <description>&lt;P&gt;You can use a Number Edit Box and set lower and upper bounds for the input, and even declare if the bounds are valid or not. You do not need to write an expression or a function to check. It is built into this display box already.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 20:36:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404454#M65489</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2021-07-27T20:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404455#M65490</link>
      <description>&lt;P&gt;Hi, thanks so much for the reply! I would like to make it so the user is forced to chose a number in range rather than have the code adjust to the user's mistake. For example, I'm thinking each number will tie to a piece of code that will be run.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here (1);&lt;BR /&gt;num = 0;&lt;BR /&gt;w = New Window( "Prompt",
	&amp;lt;&amp;lt;Modal,
	&amp;lt;&amp;lt;return result,
	V List Box(
		Text Box( "Enter Number Between 1 and 4" ),
		Text Box( "1- Option 1" ),
		Text Box( "2- Option 2" ),
		Text Box( "3- Option 3" ),
		Text Box( "4- Option 4" ),
		Text Box( "" ),
			str1 = Number Edit Box(num)
	),
);

input = w["str1"];

show(input);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then afterwards, I will code an if statement where if input == 1, run this code, if input == 2, run a different piece of code and so forth. So for my situation, I don't want the number to auto-correct to 1 or 4 if out of range. Sorry if that was confusing!&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 20:39:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404455#M65490</guid>
      <dc:creator>ozs02</dc:creator>
      <dc:date>2021-07-27T20:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404456#M65491</link>
      <description>&lt;P&gt;Wouldn't it be simpler to use Radio Box for implementation like that?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
New Window("Example", rb = Radio Box({"True", "False", "None of the above"}, Print("Selection Changed")));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Jul 2021 20:41:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404456#M65491</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-07-27T20:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404457#M65492</link>
      <description>&lt;P&gt;Hadn't seen this earlier (or have and have forgotten about it). Using &amp;lt;&amp;lt; Set Minimum and &amp;lt;&amp;lt; Set Maximum:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here (1);
num = 1;

w = New Window( "Prompt",
	&amp;lt;&amp;lt;Modal,
	&amp;lt;&amp;lt;return result,
	V List Box(
		Text Box( "Enter Number Between 1 and 4" ),
			str1 = Number Edit Box(num, &amp;lt;&amp;lt; Set Minimum(1), &amp;lt;&amp;lt; Set Maximum(4))
	),
);
input = w["str1"];
show(input);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Jul 2021 20:42:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404457#M65492</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-07-27T20:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404462#M65494</link>
      <description>&lt;P&gt;Would there be a way to prevent the user from pressing the OK button and exiting the window unless the value was 1-4? I think as it is, the user can exit the window and the input will be set to 0.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 20:54:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404462#M65494</guid>
      <dc:creator>ozs02</dc:creator>
      <dc:date>2021-07-27T20:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404463#M65495</link>
      <description>&lt;P&gt;That's a good idea! Unfortunately with this, if the user accidentally types in 6 but really wanted to type 3 instead, their input will have been automatically chosen as 4. Sorry if the problem's a bit complicated.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 20:56:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404463#M65495</guid>
      <dc:creator>ozs02</dc:creator>
      <dc:date>2021-07-27T20:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404473#M65497</link>
      <description>&lt;P&gt;I think you can use &amp;lt;&amp;lt; On Validate() for that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

If(
	ex = New Window("Dialog() example",
		&amp;lt;&amp;lt;Modal,
		&amp;lt;&amp;lt;Return Result,
		&amp;lt;&amp;lt; On Validate(1 &amp;lt;= variable &amp;lt;&amp;lt; get &amp;lt;= 4),
		V List Box(
			H List Box("Set this value", variable = Number Edit Box(42)),
			H List Box(Button Box("OK"), Button Box("Cancel"))
		)
	);
	ex["button"] == 1;
,
	ex["variable"],
	"CANCEL"
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;Or did you mean greying out/disabling the button?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

If(
	ex = New Window("Dialog() example",
		&amp;lt;&amp;lt;Modal,
		&amp;lt;&amp;lt; return result,
		V List Box(
			H List Box("Set this value", variable = Number Edit Box(42,
				&amp;lt;&amp;lt; set function(
					if(1 &amp;lt;= variable &amp;lt;&amp;lt; get &amp;lt;= 4,
						btn1 &amp;lt;&amp;lt; enable(1),
						btn1 &amp;lt;&amp;lt; enable(0)
					);
				)
			)),
			H List Box(btn1 = Button Box("OK", &amp;lt;&amp;lt; enable(0)), Button Box("Cancel"))
		)
	);
	ex["button"] == 1;
,
	ex["variable"],
	"CANCEL"
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Jul 2021 21:04:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404473#M65497</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-07-27T21:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404498#M65504</link>
      <description>&lt;P&gt;That's perfect! Thank you so much! :^)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For learning purposes, what does the end of the code mean? I know usually its If(condition 1, result 1, condition 2, result 2, ..... resultElse); but I'm not familiar with this:&amp;nbsp;&lt;/P&gt;&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;	ex["button"] == 1;
,
	ex["variable"],
	"CANCEL&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 22:14:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404498#M65504</guid>
      <dc:creator>ozs02</dc:creator>
      <dc:date>2021-07-27T22:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404660#M65517</link>
      <description>&lt;P&gt;That should be same, but it does look a bit weird. Using the modal example from Scripting Index:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This part is basically condition1 of the if:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	ex = New Window("Dialog() example",
		&amp;lt;&amp;lt;Modal,
		&amp;lt;&amp;lt;Return Result,
		V List Box(
			H List Box("Set this value", variable = Number Edit Box(42)),
			H List Box(Button Box("OK"), Button Box("Cancel"))
		)
	);
	ex["button"] == 1;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And this is the result1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ex["variable"]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and returnElse:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;"CANCEL"&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And because those results and basically last lines which will be executed depending on the if condition result, they will be printed to Log. You can test this by following two short scripts:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;a = 1; //will print 1 to Log&amp;nbsp;as&amp;nbsp;this&amp;nbsp;is&amp;nbsp;the&amp;nbsp;only&amp;nbsp;and&amp;nbsp;last&amp;nbsp;row&amp;nbsp;in&amp;nbsp;script&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;a = 1;
Write(); //will print this as it is the last row of code&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And if you did mean how ex variable works, you can fairly easily check it by running the example in scripting index and add Show(ex) in the end.&lt;/P&gt;&lt;P&gt;Below is an example with the if statement made a bit more clear by adding brackets and comments and I also added Show() for ex variable:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
If(
	( //condition1 starts
		ex = New Window("Dialog() example",
			&amp;lt;&amp;lt;Modal,
			&amp;lt;&amp;lt;Return Result,
			V List Box(
				H List Box("Set this value", variable = Number Edit Box(42)),
				H List Box(Button Box("OK"), Button Box("Cancel"))
			)
		);
		ex["button"] == 1
	), //condition1 ends
		ex["variable"]; //result1
	, //ELSE
		"CANCEL" //returnElse
);
Show(ex);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;(note due to the Show() "CANCEL" isn't the last line of code when Cancel is pressed and it won't get printed, this will also show you that the variable value will be updated even if cancel is pressed)&lt;/P&gt;&lt;P&gt;Hopefully I did explain everything correctly. You can find more info from JMP Help and Scripting Guide:&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/en/16.0/index.shtml#page/jmp/construct-a-modal-window.shtml#" target="_blank" rel="noopener"&gt;Construct a Modal Window&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 05:27:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404660#M65517</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-07-28T05:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404869#M65531</link>
      <description>&lt;P&gt;Thanks so much again, super helpful!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 16:00:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404869#M65531</guid>
      <dc:creator>ozs02</dc:creator>
      <dc:date>2021-07-28T16:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404888#M65532</link>
      <description>&lt;P&gt;If you want to run different programs depending on what users select (1-4), I would use buttons instead.&amp;nbsp; Here's what it would look like:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pmroz_0-1627492690741.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/34616i055EE4E75320ED75/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pmroz_0-1627492690741.png" alt="pmroz_0-1627492690741.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here's the code.&amp;nbsp; Note that I'm using panel box to surround the buttons, and lineup box to align both sides of the button boxes.&amp;nbsp; The programs to be run are stored in c:\myfiles, and are called program1.jsl, program2.jsl etc.&amp;nbsp; Change the folder and JSL program names to suit your situation.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;nw = new window("Test Options",
	panel box("Click the button to run the desired program",
		lineup box(ncol(1),
			b1 = button box("First Program",
				include("c:\myfiles\program1.jsl");
				nw &amp;lt;&amp;lt; close window();
			),
			b2 = button box("Second Program",
				include("c:\myfiles\program2.jsl");
				nw &amp;lt;&amp;lt; close window();
			),
			b3 = button box("Third Program",
				include("c:\myfiles\program3.jsl");
				nw &amp;lt;&amp;lt; close window();
			),
			b4 = button box("Fourth Program",
				include("c:\myfiles\program4.jsl");
				nw &amp;lt;&amp;lt; close window();
			),
		),
	),
	bexit = button box("Exit",
		nw &amp;lt;&amp;lt; close window();
	),
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Jul 2021 17:20:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404888#M65532</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2021-07-28T17:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404939#M65539</link>
      <description>&lt;P&gt;Hi! That's a great approach to the problem. I am wondering though, would I be able to share all of the program scripts so anyone with the codes can run the same programs linked to the buttons? Or would it not be possible if the file directory paths would be unique to anyone who downloads the .jsl scripts?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 19:49:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/404939#M65539</guid>
      <dc:creator>ozs02</dc:creator>
      <dc:date>2021-07-28T19:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/405595#M65560</link>
      <description>&lt;P&gt;If you reference files on a fileshare that all users can access it would work.&lt;/P&gt;
&lt;P&gt;You could also include the programs to run in the main JSL code itself as separate functions.&amp;nbsp; Here's an example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// First program
program1 = function({},
	show("Running program1");
// JSL code for first program

);

// Second program
program2 = function({},
	show("Running program2");
// JSL code for second program

);

// Third program
program3 = function({},
	show("Running program3");
// JSL code for third program

);

// Fourth program
program4 = function({},
	show("Running program4");
// JSL code for fourth program

);

nw = new window("Test Options",
	panel box("Click the button to run the desired program",
		lineup box(ncol(1),
			b1 = button box("First Program",
				program1();
			),
			b2 = button box("Second Program",
				program2();
			),
			b3 = button box("Third Program",
				program3();
			),
			b4 = button box("Fourth Program",
				program4();
			),
		),
	),
	bexit = button box("Exit",
		nw &amp;lt;&amp;lt; close window();
	),
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Take a look at the JSL documentation for more information on functions.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 15:15:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/405595#M65560</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2021-07-29T15:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/405645#M65568</link>
      <description>&lt;P&gt;That's great! I think that would work for my purposes, thanks for sharing! Lastly, this is not a super important functionality, but do you know if there is a way to press the button which executes the program and then the window closes automatically without the user pressing 'exit' ?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 17:52:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/405645#M65568</guid>
      <dc:creator>ozs02</dc:creator>
      <dc:date>2021-07-29T17:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/405648#M65569</link>
      <description>&lt;P&gt;Re-edit: It actually seems that any code coming after the button execution within the new window is running BEFORE the programs linked to the button for some reason. Does anyone know why this is happening?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 18:21:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/405648#M65569</guid>
      <dc:creator>ozs02</dc:creator>
      <dc:date>2021-07-29T18:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/405688#M65575</link>
      <description>&lt;P&gt;If you have additional code after the New Window, you could change the new window to modal window with &amp;lt;&amp;lt; modal (might require some other small changes). This example will also close the modal window if any of the program buttons is pressed by using &amp;lt;&amp;lt;Click():&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;nw = new window("Test Options", &amp;lt;&amp;lt; modal,
	panel box("Click the button to run the desired program",
		lineup box(ncol(1),
			b1 = button box("First Program",
				program1();
				okBtn &amp;lt;&amp;lt; Click();
			),
			b2 = button box("Second Program",
				program2();
				okBtn &amp;lt;&amp;lt; Click();
			),
			b3 = button box("Third Program",
				program3();
				okBtn &amp;lt;&amp;lt; Click();
			),
			b4 = button box("Fourth Program",
				program4();
				okBtn &amp;lt;&amp;lt; Click();
			),
		),
	),
	h list box(okbtn = Button Box("OK"), cancelBtn=ButtonBox("Cancel"))
);

Show("shouldnt execute before window is closed");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Jul 2021 19:23:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/405688#M65575</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-07-29T19:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Force User to Provide Input Within Range</title>
      <link>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/405700#M65577</link>
      <description>&lt;P&gt;That works perfectly! Thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 20:03:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Force-User-to-Provide-Input-Within-Range/m-p/405700#M65577</guid>
      <dc:creator>ozs02</dc:creator>
      <dc:date>2021-07-29T20:03:24Z</dc:date>
    </item>
  </channel>
</rss>

