<?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: JSL create a Query dialog in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-create-a-Query-dialog/m-p/85877#M38351</link>
    <description>&lt;P&gt;This I think would work for you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;test = New Window( "lots query", &amp;lt;&amp;lt;Modal, &amp;lt;&amp;lt;Return Result,
	Table Box(
		neb = Number Col Edit Box( "Lot List", J(1, 20,.) ),    
    ), 
    Buttonbox("Add Row", 
    	neb &amp;lt;&amp;lt; Add Row({.});
    ),
    H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
);

//because you're using return result you can do this
values = test["neb"];
//get the values that aren't missing
non_missing = loc(ismissing(values), 0);
// set values to only the non_missing values
values = values[non_missing];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But if you can query the database in advance you can select only the lots that actually exist with something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//real query would be an open database call
//dt = open database("FAKE DATABASE", 
//	"SELECT DISTINCT LOT", 
//	"Lot Numbers"
//);

//this is just a fake table for example
dt = New Table("Lot Numbers", 
	New Column("Lot", "character", Set Values({"A12", "B36", "C465", "D234"}))
);

test = New Window( "lots query", &amp;lt;&amp;lt;Modal, &amp;lt;&amp;lt;Return Result,
	lots = column(dt, "Lot") &amp;lt;&amp;lt; Get Values;
	lb_lots = listbox(lots, nlines(10), values = lb_lots &amp;lt;&amp;lt; Get Selected), 
    H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
);

show(values);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 14 Dec 2018 15:39:25 GMT</pubDate>
    <dc:creator>vince_faller</dc:creator>
    <dc:date>2018-12-14T15:39:25Z</dc:date>
    <item>
      <title>JSL create a Query dialog</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-create-a-Query-dialog/m-p/85875#M38349</link>
      <description>&lt;P&gt;hello.&lt;/P&gt;
&lt;P&gt;my&amp;nbsp;project is&amp;nbsp;to create a Query dialog with JSL.&lt;/P&gt;
&lt;P&gt;i would like to make a&amp;nbsp;dialog box &amp;nbsp;where i can put a certain number of Lots&amp;nbsp; and&amp;nbsp;put this&amp;nbsp; values in a variable&lt;/P&gt;
&lt;P&gt;so.. i&amp;nbsp;found the option "COL SPAN BOX"... seems useful.....but work only if i put one lot&amp;nbsp;Number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here the&amp;nbsp;rudimental script i&amp;nbsp;builted:&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;test = New Window( "lots query",
   &amp;lt;&amp;lt;Modal,
  &amp;lt;&amp;lt;Return Result,
  Table Box(
     Col Span Box( "Insert Lot_ID", neb = Number Col Edit Box( "Lot List", [0] ), ),
      V List Box(
         Button Box( "test" ), /
         Button Box( "OK", Lot_number = neb &amp;lt;&amp;lt; Get ),
         Button Box( "Cancel" )
        )
    )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but my scope is to have the possibility to insert&amp;nbsp;an undefinite numbers of lots and get the values for all of them.&lt;/P&gt;
&lt;P&gt;how i can modify my code (or indicate me some other way) to get my scope?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;thanks in advance&lt;/P&gt;
&lt;P&gt;Gianpaolo&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 15:25:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-create-a-Query-dialog/m-p/85875#M38349</guid>
      <dc:creator>gianpaolo</dc:creator>
      <dc:date>2018-12-14T15:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: JSL create a Query dialog</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-create-a-Query-dialog/m-p/85877#M38351</link>
      <description>&lt;P&gt;This I think would work for you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;test = New Window( "lots query", &amp;lt;&amp;lt;Modal, &amp;lt;&amp;lt;Return Result,
	Table Box(
		neb = Number Col Edit Box( "Lot List", J(1, 20,.) ),    
    ), 
    Buttonbox("Add Row", 
    	neb &amp;lt;&amp;lt; Add Row({.});
    ),
    H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
);

//because you're using return result you can do this
values = test["neb"];
//get the values that aren't missing
non_missing = loc(ismissing(values), 0);
// set values to only the non_missing values
values = values[non_missing];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But if you can query the database in advance you can select only the lots that actually exist with something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//real query would be an open database call
//dt = open database("FAKE DATABASE", 
//	"SELECT DISTINCT LOT", 
//	"Lot Numbers"
//);

//this is just a fake table for example
dt = New Table("Lot Numbers", 
	New Column("Lot", "character", Set Values({"A12", "B36", "C465", "D234"}))
);

test = New Window( "lots query", &amp;lt;&amp;lt;Modal, &amp;lt;&amp;lt;Return Result,
	lots = column(dt, "Lot") &amp;lt;&amp;lt; Get Values;
	lb_lots = listbox(lots, nlines(10), values = lb_lots &amp;lt;&amp;lt; Get Selected), 
    H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
);

show(values);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Dec 2018 15:39:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-create-a-Query-dialog/m-p/85877#M38351</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2018-12-14T15:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: JSL create a Query dialog</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-create-a-Query-dialog/m-p/85878#M38352</link>
      <description>&lt;P&gt;woww!!! very nice script Vince&lt;/P&gt;&lt;P&gt;the first solution is the one&amp;nbsp; closest to my query dialog Query!!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if now i have a batch of lots.. and i want to make copy /past in the dialog box.. and get the values do you think is possible?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 15:48:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-create-a-Query-dialog/m-p/85878#M38352</guid>
      <dc:creator>gianpaolo</dc:creator>
      <dc:date>2018-12-14T15:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: JSL create a Query dialog</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-create-a-Query-dialog/m-p/85882#M38354</link>
      <description>Yeah that's native.  You don't even need to do anything.  Just copy from excel and when you paste it should paste properly.</description>
      <pubDate>Fri, 14 Dec 2018 15:55:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-create-a-Query-dialog/m-p/85882#M38354</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2018-12-14T15:55:32Z</dc:date>
    </item>
  </channel>
</rss>

