<?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: Newb JSL Question: How to get the content of a Text Edit Box into a variable? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Newb-JSL-Question-How-to-get-the-content-of-a-Text-Edit-Box-into/m-p/109744#M39680</link>
    <description>&lt;P&gt;Look at the examples using "Return Result" in&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/14-2/constructors-for-new-windows.shtml" target="_self"&gt;https://www.jmp.com/support/help/14-2/constructors-for-new-windows.shtml&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Also in your example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	H List Box (
		Text Box ("  Define Prefix "),
		tt1 = Text Edit Box (""),
		prefix = (tt1 &amp;lt;&amp;lt; Get Text) // I cannot figure out how to assign the content of "tt1" to "prefix""
	),	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the tt1=... and prefix=... arguments to HListBox are executed when the hlistbox is being created. tt1 results in a textEditBox that HListBox keeps. I'm pretty certain the prefix value, "", is being ignored by the hlistbox. I'm away from my desk, but I think the textEditBox might be able to run some JSL as a second argument when the value changes...maybe you want something closer to &lt;EM&gt;tt1=texteditbox("", prefix=(tt1&amp;lt;&amp;lt;gettext) ).&lt;/EM&gt;&amp;nbsp; If that works, you might not need to use "Return Result".&lt;/P&gt;</description>
    <pubDate>Sat, 09 Feb 2019 21:16:00 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2019-02-09T21:16:00Z</dc:date>
    <item>
      <title>Newb JSL Question: How to get the content of a Text Edit Box into a variable?</title>
      <link>https://community.jmp.com/t5/Discussions/Newb-JSL-Question-How-to-get-the-content-of-a-Text-Edit-Box-into/m-p/109742#M39678</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm a beginner in JSL (JMP 13.1) and I'm struggling with the interactive dialog logic especially how to extract the content of a Text Edit Box into a variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a snippet of a JSL script that does not work (i.e. the variable "prefix" is not updated with the content of the Text Edit Box "tt1).&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;prefix = "";
win = New Window ("   TEST   ",
	&amp;lt;&amp;lt; Modal,
	&amp;lt;&amp;lt; On Validate (
		
		if (Is Missing (prefix),0,1);
	),

	H List Box (
		Text Box ("  Define Prefix "),
		tt1 = Text Edit Box (""),
		prefix = (tt1 &amp;lt;&amp;lt; Get Text) // I cannot figure out how to assign the content of "tt1" to "prefix""
	),	
);

Show (tt1, prefix);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Feb 2019 20:32:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Newb-JSL-Question-How-to-get-the-content-of-a-Text-Edit-Box-into/m-p/109742#M39678</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2019-02-09T20:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Newb JSL Question: How to get the content of a Text Edit Box into a variable?</title>
      <link>https://community.jmp.com/t5/Discussions/Newb-JSL-Question-How-to-get-the-content-of-a-Text-Edit-Box-into/m-p/109744#M39680</link>
      <description>&lt;P&gt;Look at the examples using "Return Result" in&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/14-2/constructors-for-new-windows.shtml" target="_self"&gt;https://www.jmp.com/support/help/14-2/constructors-for-new-windows.shtml&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Also in your example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	H List Box (
		Text Box ("  Define Prefix "),
		tt1 = Text Edit Box (""),
		prefix = (tt1 &amp;lt;&amp;lt; Get Text) // I cannot figure out how to assign the content of "tt1" to "prefix""
	),	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the tt1=... and prefix=... arguments to HListBox are executed when the hlistbox is being created. tt1 results in a textEditBox that HListBox keeps. I'm pretty certain the prefix value, "", is being ignored by the hlistbox. I'm away from my desk, but I think the textEditBox might be able to run some JSL as a second argument when the value changes...maybe you want something closer to &lt;EM&gt;tt1=texteditbox("", prefix=(tt1&amp;lt;&amp;lt;gettext) ).&lt;/EM&gt;&amp;nbsp; If that works, you might not need to use "Return Result".&lt;/P&gt;</description>
      <pubDate>Sat, 09 Feb 2019 21:16:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Newb-JSL-Question-How-to-get-the-content-of-a-Text-Edit-Box-into/m-p/109744#M39680</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2019-02-09T21:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Newb JSL Question: How to get the content of a Text Edit Box into a variable?</title>
      <link>https://community.jmp.com/t5/Discussions/Newb-JSL-Question-How-to-get-the-content-of-a-Text-Edit-Box-into/m-p/109759#M39683</link>
      <description>Hi Craig,&lt;BR /&gt;&lt;BR /&gt;Thank you for your help: I already tried moving the line "prefix = (tt1 &amp;lt;&amp;lt; Get Text) within the Text Edit Box call but I'm getting an error message "The display box 'TextEditBox' does not recognize the message 'Assign' ".&lt;BR /&gt;I have not yet figured out how incorporate the Return Result switch</description>
      <pubDate>Sat, 09 Feb 2019 22:25:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Newb-JSL-Question-How-to-get-the-content-of-a-Text-Edit-Box-into/m-p/109759#M39683</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2019-02-09T22:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Newb JSL Question: How to get the content of a Text Edit Box into a variable?</title>
      <link>https://community.jmp.com/t5/Discussions/Newb-JSL-Question-How-to-get-the-content-of-a-Text-Edit-Box-into/m-p/109764#M39687</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;win = New Window( "Set a Value in Number Edit Box",
	&amp;lt;&amp;lt;Modal,
	&amp;lt;&amp;lt;Return Result,
	Text Box( "Set this value" ),
	numberbox = Number Edit Box( 42 ),
	texteditbox = TextEdit Box( "this one too" ),
	Button Box( "OK" ),
	Button Box( "Cancel" )
);
Write( win["numberbox"] );
Write( win["texteditbox"] );
show(win);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When the modal window closes, the returned value is a list of the content of the boxes that had assignments:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;win = {numberbox = 3.1415, texteditbox = "argyle", Button(1)};&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The button(1) means the OK button, -1 is the cancel button.&lt;/P&gt;
&lt;P&gt;win["numberbox"] is a way to ask the list to search its members for the assignment and return the value.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 01:34:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Newb-JSL-Question-How-to-get-the-content-of-a-Text-Edit-Box-into/m-p/109764#M39687</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2019-02-10T01:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Newb JSL Question: How to get the content of a Text Edit Box into a variable?</title>
      <link>https://community.jmp.com/t5/Discussions/Newb-JSL-Question-How-to-get-the-content-of-a-Text-Edit-Box-into/m-p/109765#M39688</link>
      <description>&lt;P&gt;Place the script that sets the prefix value, into the script that is executed when the text edit box is changed&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
prefix = "";
win = New Window( "   TEST   ",
	&amp;lt;&amp;lt;Modal,
	&amp;lt;&amp;lt;On Validate(
		
		If( Is Missing( prefix ),
			0,
			1
		)
	), 

	H List Box(
		Text Box( "  Define Prefix " ),
		tt1 = Text Edit Box( "", &amp;lt;&amp;lt;set script( prefix = (tt1 &amp;lt;&amp;lt; Get Text) ) ) // I cannot figure out how to assign the content of "tt1" to "prefix""
	),

);

Show( tt1, prefix );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 10 Feb 2019 01:38:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Newb-JSL-Question-How-to-get-the-content-of-a-Text-Edit-Box-into/m-p/109765#M39688</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-02-10T01:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Newb JSL Question: How to get the content of a Text Edit Box into a variable?</title>
      <link>https://community.jmp.com/t5/Discussions/Newb-JSL-Question-How-to-get-the-content-of-a-Text-Edit-Box-into/m-p/109774#M39689</link>
      <description>&lt;P&gt;You are currently placing the assignment script in a function that is expecting display boxes.&amp;nbsp; Here are the different places you could put the line:&lt;/P&gt;
&lt;P&gt;1/ based on your code, you are validating the window based on the value of the prefix, so you could put a line prior to the conditional test&lt;/P&gt;
&lt;P&gt;2/ after the new window call, to unpick the contents of the window once the user has clicked OK&lt;/P&gt;
&lt;P&gt;3/ inside an onClose event, created using similar syntax to onValidate (achieves the same as (2) but is more elegant and more robust going across Windows/Mac platforms&lt;/P&gt;
&lt;P&gt;4/ inside an event handler attached to the display box itself&lt;/P&gt;
&lt;P&gt;Given that you are validating the form I would choose the first option:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;prefix = "";
win = New Window ("   TEST   ",
	&amp;lt;&amp;lt; Modal,
	&amp;lt;&amp;lt; On Validate (
		prefix = tt1 &amp;lt;&amp;lt; Get Text;
		if (Is Missing (prefix),0,1);
	),

	H List Box (
		Text Box ("  Define Prefix "),
		tt1 = Text Edit Box (""),
	),	
);

Show (tt1, prefix);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 13:56:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Newb-JSL-Question-How-to-get-the-content-of-a-Text-Edit-Box-into/m-p/109774#M39689</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2019-02-10T13:56:58Z</dc:date>
    </item>
  </channel>
</rss>

