<?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: How to pull data from a combo box that has a text edit box and number edit box? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-pull-data-from-a-combo-box-that-has-a-text-edit-box-and/m-p/60873#M33106</link>
    <description>&lt;P&gt;Your application still is not clear to me. However, your script is&amp;nbsp; throwing errors, because the actions associated with the OK ButtonBox assumes all 7 number edit and text edit boxes exist. However only the boxes you created exist.&lt;/P&gt;&lt;P&gt;I suggest you create all 7 sets of boxes, get all seven sets of results but only use the number specified.&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;			firstdigit = y &amp;lt;&amp;lt; get();
			seconddigit = y2  &amp;lt;&amp;lt; get();
			thirddigit = y3  &amp;lt;&amp;lt; get();
			fourthdigit = y4  &amp;lt;&amp;lt; get();
			fifthdigit = y5  &amp;lt;&amp;lt; get();
			sixthdigit = y6  &amp;lt;&amp;lt; get();
			seventhdigit = y7  &amp;lt;&amp;lt; get();
			
			
			firstColumnName = z  &amp;lt;&amp;lt; getText();
			secondColumnName =  z2  &amp;lt;&amp;lt; getText();
			thirdColumnName =  z3  &amp;lt;&amp;lt; getText();
			fourthColumnName = z4  &amp;lt;&amp;lt; getText();
			fifthColumnName =  z5  &amp;lt;&amp;lt; getText();
			sixthColumnName = z6  &amp;lt;&amp;lt; getText();
			seventhColumnName = z7  &amp;lt;&amp;lt; getText();&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I'll post an alternative later.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jun 2018 00:10:57 GMT</pubDate>
    <dc:creator>gzmorgan0</dc:creator>
    <dc:date>2018-06-22T00:10:57Z</dc:date>
    <item>
      <title>How to pull data from a combo box that has a text edit box and number edit box?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-pull-data-from-a-combo-box-that-has-a-text-edit-box-and/m-p/60824#M33096</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im currently trying to create a script that will create columns in a data table based on user inputs. It will first ask the user for the column name, then parse the names in the columns into different characters depending on user inputs. I'm having trouble with the get evaluation if there are less than 7 options picked in the combo box. Im currently getting the error that the deleted boxes are cannot be evaluated of 'Glue'. is there a way around this? I've tried the try function and it gave me some weird values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;clearlog();

dt = Current Data Table();
nc = ncol(dt);

New Window("SID parser",
	H List Box("Main Box",
		V List Box("VLISTBOXcolumn names",
			PanelBox("Select Column",
				colListData=ColListBox(All,nLines(min(nc,10)))
			), //end panel box
		), // end VLISTBOXcolumn names
		V List Box("VLISTBOXDIGITS",
			Text Box("Select Number of Columns"),
			x = Combo Box( {"1", "2","3","4","5","6","7"},
				&amp;lt;&amp;lt; set function( Function( {this},
				value = this &amp;lt;&amp;lt; get;
				If(
					value == 1,
					Try( (this &amp;lt;&amp;lt; sib) &amp;lt;&amp;lt; deletebox ); // delete what might already exist
					this &amp;lt;&amp;lt; sibappend( 
						V List Box( 
							H List Box(
								Text Box("Number of Characters"),
								y = Number Edit Box(2,4),
								Text Box("Column Name"),
								z = Text Edit Box("Protocol"),
								z &amp;lt;&amp;lt; set width(100),
							) // end 1st column HLISTBOX
						)	
					), 
					
					value == 2,
					Try( (this &amp;lt;&amp;lt; sib) &amp;lt;&amp;lt; deletebox ); // delete what might already exist
					this &amp;lt;&amp;lt; sibappend( // add new box
						V List Box( 
							H List Box(
								Text Box("Number of Characters"),
								y = Number Edit Box(2,4),
								Text Box("Column Name"),
								z = Text Edit Box("Protocol"),
								z &amp;lt;&amp;lt; set width(100),
								), // end 1st column HLISTBOX
							H List Box(
								Text Box("Number of Characters"),
								y2 = Number Edit Box(3,4),
								Text Box("Column Name"),
								z2 = Text Edit Box("Optional"),
								z2 &amp;lt;&amp;lt; set width(100),
							) // end 2nd column h list box
						) //end VLISTBOX
					), // end sib append
					
					value == 3,
					Try( (this &amp;lt;&amp;lt; sib) &amp;lt;&amp;lt; deletebox ); // delete what might already exist
					this &amp;lt;&amp;lt; sibappend( // add new box
						V List Box( 
							H List Box(
								Text Box("Number of Characters"),
								y = Number Edit Box(2,4),
								Text Box("Column Name"),
								z = Text Edit Box("Protocol"),
								z &amp;lt;&amp;lt; set width(100),
								), // end 1st column HLISTBOX
							H List Box(
								Text Box("Number of Characters"),
								y2 = Number Edit Box(3,4),
								Text Box("Column Name"),
								z2 = Text Edit Box("Optional"),
								z2 &amp;lt;&amp;lt; set width(100),
							), // end 2nd column h list box
							H List Box(
								Text Box("Number of Characters"),
								y3 = Number Edit Box(3,4),
								Text Box("Column Name"),
								z3 = Text Edit Box("Tube Type"),
								z3 &amp;lt;&amp;lt; set width(100),
							), // end 3rd column h list box
						) //end VLISTBOX
					), // end sib append
					
					value == 4,
					Try( (this &amp;lt;&amp;lt; sib) &amp;lt;&amp;lt; deletebox ); // delete what might already exist
					this &amp;lt;&amp;lt; sibappend( // add new box
						V List Box( 
							H List Box(
								Text Box("Number of Characters"),
								y = Number Edit Box(2,4),
								Text Box("Column Name"),
								z = Text Edit Box("Protocol"),
								z &amp;lt;&amp;lt; set width(100),
								), // end 1st column HLISTBOX
							H List Box(
								Text Box("Number of Characters"),
								y2 = Number Edit Box(3,4),
								Text Box("Column Name"),
								z2 = Text Edit Box("Optional"),
								z2 &amp;lt;&amp;lt; set width(100),
							), // end 2nd column h list box
							H List Box(
								Text Box("Number of Characters"),
								y3 = Number Edit Box(3,4),
								Text Box("Column Name"),
								z3 = Text Edit Box("Tube Type"),
								z3 &amp;lt;&amp;lt; set width(100),
							), // end 3rd column h list box
							H List Box(
								Text Box("Number of Characters"),
								y4 = Number Edit Box(3,4),
								Text Box("Column Name"),
								z4 = Text Edit Box("Sample Number"),
								z4 &amp;lt;&amp;lt; set width(100),
							), // end 4th column h list box
						), //end VLISTBOX
					), // end sib append
					
					value == 5,
					Try( (this &amp;lt;&amp;lt; sib) &amp;lt;&amp;lt; deletebox ); // delete what might already exist
					this &amp;lt;&amp;lt; sibappend( // add new box
						V List Box( 
							H List Box(
								Text Box("Number of Characters"),
								y = Number Edit Box(2,4),
								Text Box("Column Name"),
								z = Text Edit Box("Protocol"),
								z &amp;lt;&amp;lt; set width(100),
								), // end 1st column HLISTBOX
							H List Box(
								Text Box("Number of Characters"),
								y2 = Number Edit Box(1,4),
								Text Box("Column Name"),
								z2 = Text Edit Box("Optional"),
								z2 &amp;lt;&amp;lt; set width(100),
							), // end 2nd column h list box
							H List Box(
								Text Box("Number of Characters"),
								y3 = Number Edit Box(3,4),
								Text Box("Column Name"),
								z3 = Text Edit Box("Tube Type"),
								z3 &amp;lt;&amp;lt; set width(100),
							), // end 3rd column h list box
							H List Box(
								Text Box("Number of Characters"),
								y4 = Number Edit Box(3,4),
								Text Box("Column Name"),
								z4 = Text Edit Box("Sample Number"),
								z4 &amp;lt;&amp;lt; set width(100),
							), // end 4th column h list box
							H List Box(
								Text Box("Number of Characters"),
								y5 = Number Edit Box(1,4),
								Text Box("Column Name"),
								z5 = Text Edit Box("Analyte Level"),
								z5 &amp;lt;&amp;lt; set width(100),
							), // end 5th column h list box
						), //end VLISTBOX
					), // end sib append
					
					value == 6,
					Try( (this &amp;lt;&amp;lt; sib) &amp;lt;&amp;lt; deletebox ); // delete what might already exist
					this &amp;lt;&amp;lt; sibappend( // add new box
						V List Box( 
							H List Box(
								Text Box("Number of Characters"),
								y = Number Edit Box(2,4),
								Text Box("Column Name"),
								z = Text Edit Box("Protocol"),
								z &amp;lt;&amp;lt; set width(100),
								), // end 1st column HLISTBOX
							H List Box(
								Text Box("Number of Characters"),
								y2 = Number Edit Box(1,4),
								Text Box("Column Name"),
								z2 = Text Edit Box("Optional"),
								z2 &amp;lt;&amp;lt; set width(100),
							), // end 2nd column h list box
							H List Box(
								Text Box("Number of Characters"),
								y3 = Number Edit Box(3,4),
								Text Box("Column Name"),
								z3 = Text Edit Box("Tube Type"),
								z3 &amp;lt;&amp;lt; set width(100),
							), // end 3rd column h list box
							H List Box(
								Text Box("Number of Characters"),
								y4 = Number Edit Box(3,4),
								Text Box("Column Name"),
								z4 = Text Edit Box("Sample Number"),
								z4 &amp;lt;&amp;lt; set width(100),
							), // end 4th column h list box
							H List Box(
								Text Box("Number of Characters"),
								y5 = Number Edit Box(1,4),
								Text Box("Column Name"),
								z5 = Text Edit Box("Analyte Level"),
								z5 &amp;lt;&amp;lt; set width(100),
							), // end 5th column h list box
							H List Box(
								Text Box("Number of Characters"),
								y6 = Number Edit Box(1,4),
								Text Box("Column Name"),
								z6 = Text Edit Box("Run"),
								z6 &amp;lt;&amp;lt; set width(100),
							), // end 6th column h list box
						), //end VLISTBOX
					), // end sib append
					
					value == 7,
					Try( (this &amp;lt;&amp;lt; sib) &amp;lt;&amp;lt; deletebox ); // delete what might already exist
					this &amp;lt;&amp;lt; sibappend( // add new box
						V List Box( 
							H List Box(
								Text Box("Number of Characters"),
								y = Number Edit Box(2,4),
								Text Box("Column Name"),
								z = Text Edit Box("Protocol"),
								z &amp;lt;&amp;lt; set width(100),
								), // end 1st column HLISTBOX
							H List Box(
								Text Box("Number of Characters"),
								y2 = Number Edit Box(1,4),
								Text Box("Column Name"),
								z2 = Text Edit Box("Optional"),
								z2 &amp;lt;&amp;lt; set width(100),
							), // end 2nd column h list box
							H List Box(
								Text Box("Number of Characters"),
								y3 = Number Edit Box(3,4),
								Text Box("Column Name"),
								z3 = Text Edit Box("Tube Type"),
								z3 &amp;lt;&amp;lt; set width(100),
							), // end 3rd column h list box
							H List Box(
								Text Box("Number of Characters"),
								y4 = Number Edit Box(3,4),
								Text Box("Column Name"),
								z4 = Text Edit Box("Sample Number"),
								z4 &amp;lt;&amp;lt; set width(100),
							), // end 4th column h list box
							H List Box(
								Text Box("Number of Characters"),
								y5 = Number Edit Box(1,4),
								Text Box("Column Name"),
								z5 = Text Edit Box("Analyte Level"),
								z5 &amp;lt;&amp;lt; set width(100),
							), // end 5th column h list box
							H List Box(
								Text Box("Number of Characters"),
								y6 = Number Edit Box(1,4),
								Text Box("Column Name"),
								z6 = Text Edit Box("Run"),
								z6 &amp;lt;&amp;lt; set width(100),
							), // end 6th column h list box
							H List Box(
								Text Box("Number of Characters"),
								y7 = Number Edit Box(1,4),
								Text Box("Column Name"),
								z7 = Text Edit Box("extra"),
								z7 &amp;lt;&amp;lt; set width(100),
							), // end 7th column h list box
						), //end VLISTBOX
					); // end sib append
					
				); // end if statement
			)) //end function

    ), //end combo box
		V List Box( 
			H List Box(
				Text Box("Number of Characters"),
				y = Number Edit Box(2,4),
				Text Box("Column Name"),
				z = Text Edit Box("Protocol"),
				z &amp;lt;&amp;lt; set width(100),
			) // end 1st column HLISTBOX
		); // since 1 is selected by default, put the box here initially
	), //end VLISTBOXDIGITS
	), // end HLISTBOX Main Box
	H List Box("OK and Cancel",
		Button Box("OK",
			Print( "Pressed OK");
			SelectedColumn = colListData &amp;lt;&amp;lt; getSelected;
			
			firstdigit = y &amp;lt;&amp;lt; get();
			seconddigit = y2  &amp;lt;&amp;lt; get();
			thirddigit = y3  &amp;lt;&amp;lt; get();
			fourthdigit = y4  &amp;lt;&amp;lt; get();
			fifthdigit = y5  &amp;lt;&amp;lt; get();
			sixthdigit = y6  &amp;lt;&amp;lt; get();
			seventhdigit = y7  &amp;lt;&amp;lt; get();
			
			
			firstColumnName = z  &amp;lt;&amp;lt; getText();
			secondColumnName =  z2  &amp;lt;&amp;lt; getText();
			thirdColumnName =  z3  &amp;lt;&amp;lt; getText();
			fourthColumnName = z4  &amp;lt;&amp;lt; getText();
			fifthColumnName =  z5  &amp;lt;&amp;lt; getText();
			sixthColumnName = z6  &amp;lt;&amp;lt; getText();
			seventhColumnName = z7  &amp;lt;&amp;lt; getText();
						
			currentwindow() &amp;lt;&amp;lt; closewindow()
			
		), // end Button Box OK
		Button Box("Cancel", currentwindow() &amp;lt;&amp;lt; closewindow())
	), // end Button Box Cancel
); //end SID parser dialog box

try( dt &amp;lt;&amp;lt; Delete Column( ascolumn(firstColumnName)) );
dt &amp;lt;&amp;lt; new column(firstColumnName, character, nominal,
	Formula(substr(ascolumn(SelectedColumn),0,firstdigit),empty())
);

try( dt &amp;lt;&amp;lt; Delete Column( ascolumn(secondColumnName)) );
dt &amp;lt;&amp;lt; new column(secondColumnName, character, nominal,
	Formula(substr(ascolumn(SelectedColumn),Add(firstdigit,1),seconddigit),empty())
);

try( dt &amp;lt;&amp;lt; Delete Column( ascolumn(thirdColumnName)) );
dt &amp;lt;&amp;lt; new column(thirdColumnName, character, nominal,
	Formula(substr(ascolumn(SelectedColumn),Add(firstdigit,seconddigit,1),thirddigit),empty())
);

try( dt &amp;lt;&amp;lt; Delete Column( ascolumn(fourthColumnName)) );
dt &amp;lt;&amp;lt; new column(fourthColumnName, character, nominal,
	Formula(substr(ascolumn(SelectedColumn),Add(firstdigit,seconddigit,thirddigit,1),fourthdigit),empty())
);

try( dt &amp;lt;&amp;lt; Delete Column( ascolumn(fifthColumnName)) );
dt &amp;lt;&amp;lt; new column(fifthColumnName, character, nominal,
	Formula(substr(ascolumn(SelectedColumn),Add(firstdigit,seconddigit,thirddigit,fourthdigit,1),fifthdigit),empty())
);

try( dt &amp;lt;&amp;lt; Delete Column( ascolumn(sixthColumnName)) );
dt &amp;lt;&amp;lt; new column(sixthColumnName, character, nominal,
	Formula(substr(ascolumn(SelectedColumn),Add(firstdigit,seconddigit,thirddigit,fourthdigit,fifthdigit,1),sixthdigit),empty())
);

try( dt &amp;lt;&amp;lt; Delete Column( ascolumn(seventhColumnName)) );
dt &amp;lt;&amp;lt; new column(seventhColumnName, character, nominal,
	Formula(substr(ascolumn(SelectedColumn),Add(firstdigit,seconddigit,thirddigit,fourthdigit,fifthdigit,sixthdigit,1),seventhdigit),empty())&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jun 2018 19:26:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-pull-data-from-a-combo-box-that-has-a-text-edit-box-and/m-p/60824#M33096</guid>
      <dc:creator>andylin127</dc:creator>
      <dc:date>2018-06-21T19:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to pull data from a combo box that has a text edit box and number edit box?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-pull-data-from-a-combo-box-that-has-a-text-edit-box-and/m-p/60873#M33106</link>
      <description>&lt;P&gt;Your application still is not clear to me. However, your script is&amp;nbsp; throwing errors, because the actions associated with the OK ButtonBox assumes all 7 number edit and text edit boxes exist. However only the boxes you created exist.&lt;/P&gt;&lt;P&gt;I suggest you create all 7 sets of boxes, get all seven sets of results but only use the number specified.&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;			firstdigit = y &amp;lt;&amp;lt; get();
			seconddigit = y2  &amp;lt;&amp;lt; get();
			thirddigit = y3  &amp;lt;&amp;lt; get();
			fourthdigit = y4  &amp;lt;&amp;lt; get();
			fifthdigit = y5  &amp;lt;&amp;lt; get();
			sixthdigit = y6  &amp;lt;&amp;lt; get();
			seventhdigit = y7  &amp;lt;&amp;lt; get();
			
			
			firstColumnName = z  &amp;lt;&amp;lt; getText();
			secondColumnName =  z2  &amp;lt;&amp;lt; getText();
			thirdColumnName =  z3  &amp;lt;&amp;lt; getText();
			fourthColumnName = z4  &amp;lt;&amp;lt; getText();
			fifthColumnName =  z5  &amp;lt;&amp;lt; getText();
			sixthColumnName = z6  &amp;lt;&amp;lt; getText();
			seventhColumnName = z7  &amp;lt;&amp;lt; getText();&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I'll post an alternative later.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 00:10:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-pull-data-from-a-combo-box-that-has-a-text-edit-box-and/m-p/60873#M33106</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-06-22T00:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to pull data from a combo box that has a text edit box and number edit box?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-pull-data-from-a-combo-box-that-has-a-text-edit-box-and/m-p/60888#M33108</link>
      <description>&lt;P&gt;The second poblem with your script is that your dialog window is not Modal, which means the JSL after the New Window does not wait for the OK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached 2 scripts, that are alternatives, showing different methods to make your display dynamic.&amp;nbsp; These scripts use Big Class that has a new column named Test. Select that column (Test) . This window allows the user to change their mind, if they accidentally hit 5 but meant 6, try selecting different values.&amp;nbsp; All 7 HListBoxes are on the window but only the numebr selected are visible and names and values are retreived (&amp;lt;&amp;lt;get) with the OK script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These scipts&amp;nbsp; might not meet your exact needs but should give you some ideas about alternatives to copy/paste (aka brute force) code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Dialog" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/11215iC13F897C9ACEDF6B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="image.png" alt="Dialog" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Dialog&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Results" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/11216iF448D58FB33AF575/image-size/medium?v=v2&amp;amp;px=400" role="button" title="image.png" alt="Results" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Results&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jun 2018 04:17:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-pull-data-from-a-combo-box-that-has-a-text-edit-box-and/m-p/60888#M33108</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-06-22T04:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to pull data from a combo box that has a text edit box and number edit box?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-pull-data-from-a-combo-box-that-has-a-text-edit-box-and/m-p/60988#M33139</link>
      <description>Thanks this helps so much!</description>
      <pubDate>Fri, 22 Jun 2018 21:37:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-pull-data-from-a-combo-box-that-has-a-text-edit-box-and/m-p/60988#M33139</guid>
      <dc:creator>andylin127</dc:creator>
      <dc:date>2018-06-22T21:37:54Z</dc:date>
    </item>
  </channel>
</rss>

