<?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: IF Statement according to user input in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/IF-Statement-according-to-user-input/m-p/310080#M56362</link>
    <description>&lt;P&gt;You can be a more direct with your user interface.&amp;nbsp; Try this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
nw = new window("Test",
	panel box("Click the icon to run the program: ",
		lineup box(ncol(2),
			text box("1. Tree Map"),
			button box("", &amp;lt;&amp;lt; set icon("TreeMap"),
				&amp;lt;&amp;lt; set function(include("treemap.jsl"))),

			text box("2. Neural Net"),
			button box("", &amp;lt;&amp;lt; set icon("NeuralNet"), 
				&amp;lt;&amp;lt; set function(include("NeuralNet.jsl"))),

			text box("3. Model Comparison"),
			button box("", &amp;lt;&amp;lt; set icon("ModelComparison"), 
				&amp;lt;&amp;lt; set function(include("ModelComparison.jsl"))),

			text box("4. SAS Pyramid"),
			button box("", &amp;lt;&amp;lt; set icon("SASPyramid"), 
				&amp;lt;&amp;lt; set function(include("SASPyramid.jsl"))),
		),
	),
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You would substitute the appropriate code where I have &amp;lt;include("xxx.jsl")&amp;gt;.&amp;nbsp; To get the various icons use Justin Chilton's&amp;nbsp;&lt;A href="https://community.jmp.com/t5/JMP-Add-Ins/Built-In-JMP-Icons/ta-p/42251" target="_self"&gt;Built in JMP Icons&lt;/A&gt;&amp;nbsp;addin.&lt;/P&gt;
&lt;DIV id="tinyMceEditorpmroz_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Mon, 21 Sep 2020 14:13:06 GMT</pubDate>
    <dc:creator>pmroz</dc:creator>
    <dc:date>2020-09-21T14:13:06Z</dc:date>
    <item>
      <title>IF Statement according to user input</title>
      <link>https://community.jmp.com/t5/Discussions/IF-Statement-according-to-user-input/m-p/309988#M56353</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to create a basic script with an IF statement, I'm not that familiar if a CASE statement exist in JMP but what I'm try to do is similar to a case statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Ask the user to input a number ranging from 1-20 only&lt;/P&gt;&lt;P&gt;2. Create an if statement and execute the command with accordance to the user input&lt;/P&gt;&lt;P&gt;&amp;nbsp;For example: User input : 2&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *Executes script inside bracket 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you advise a basic tutorial set that might help with this?&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 20:39:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/IF-Statement-according-to-user-input/m-p/309988#M56353</guid>
      <dc:creator>UserID16644</dc:creator>
      <dc:date>2023-06-10T20:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: IF Statement according to user input</title>
      <link>https://community.jmp.com/t5/Discussions/IF-Statement-according-to-user-input/m-p/310027#M56355</link>
      <description>&lt;P&gt;You can try something like this :)&lt;/img&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;userinput = New Window( "Collect user input",	&amp;lt;&amp;lt;Modal, &amp;lt;&amp;lt;Return Result,
	V List Box(
		H List Box(
			Text Box("Input a number from 1 to 20: "),
			number = Text Edit box("")
		),
		Spacer Box(Size(10, 10)),
		H List Box( Spacer Box( 10, 80 ), Button Box( "OK" ), Button Box( "Cancel" ) ), 
	)		
);

If( userinput["Button"] == -1,
	db &amp;lt;&amp;lt; close
);

number_input = userinput["number"];
if(num(number_input) &amp;lt; 1 | num(number_input) &amp;gt; 20,
	New Window("Error!!", Text Box("  Please input a number from 1 to 20 ONLY!  ")),
	if(num(number_input) == 1,
		//DO SOMETHING...
	num(number_input) == 2,
		//DO SOMETHING...
	);
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Sep 2020 07:11:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/IF-Statement-according-to-user-input/m-p/310027#M56355</guid>
      <dc:creator>ThuongLe</dc:creator>
      <dc:date>2020-09-21T07:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: IF Statement according to user input</title>
      <link>https://community.jmp.com/t5/Discussions/IF-Statement-according-to-user-input/m-p/310080#M56362</link>
      <description>&lt;P&gt;You can be a more direct with your user interface.&amp;nbsp; Try this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
nw = new window("Test",
	panel box("Click the icon to run the program: ",
		lineup box(ncol(2),
			text box("1. Tree Map"),
			button box("", &amp;lt;&amp;lt; set icon("TreeMap"),
				&amp;lt;&amp;lt; set function(include("treemap.jsl"))),

			text box("2. Neural Net"),
			button box("", &amp;lt;&amp;lt; set icon("NeuralNet"), 
				&amp;lt;&amp;lt; set function(include("NeuralNet.jsl"))),

			text box("3. Model Comparison"),
			button box("", &amp;lt;&amp;lt; set icon("ModelComparison"), 
				&amp;lt;&amp;lt; set function(include("ModelComparison.jsl"))),

			text box("4. SAS Pyramid"),
			button box("", &amp;lt;&amp;lt; set icon("SASPyramid"), 
				&amp;lt;&amp;lt; set function(include("SASPyramid.jsl"))),
		),
	),
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You would substitute the appropriate code where I have &amp;lt;include("xxx.jsl")&amp;gt;.&amp;nbsp; To get the various icons use Justin Chilton's&amp;nbsp;&lt;A href="https://community.jmp.com/t5/JMP-Add-Ins/Built-In-JMP-Icons/ta-p/42251" target="_self"&gt;Built in JMP Icons&lt;/A&gt;&amp;nbsp;addin.&lt;/P&gt;
&lt;DIV id="tinyMceEditorpmroz_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 21 Sep 2020 14:13:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/IF-Statement-according-to-user-input/m-p/310080#M56362</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2020-09-21T14:13:06Z</dc:date>
    </item>
  </channel>
</rss>

