<?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 &amp;gt; Preserving Default Entries for Text Edit Box: Code Improvement in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-gt-Preserving-Default-Entries-for-Text-Edit-Box-Code/m-p/339503#M58771</link>
    <description>Hi Jim,&lt;BR /&gt;Always on top of things and right on the money.&lt;BR /&gt;Thanks,&lt;BR /&gt;TS</description>
    <pubDate>Sat, 05 Dec 2020 21:12:07 GMT</pubDate>
    <dc:creator>Thierry_S</dc:creator>
    <dc:date>2020-12-05T21:12:07Z</dc:date>
    <item>
      <title>JSL &gt; Preserving Default Entries for Text Edit Box: Code Improvement</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-gt-Preserving-Default-Entries-for-Text-Edit-Box-Code/m-p/339483#M58769</link>
      <description>&lt;P&gt;Hi JMP Community,&lt;/P&gt;&lt;P&gt;I have been toying with a short script to group column automatically based on a starting and ending string.While this work fine on my local machine, I would like to know if there is a better way to preserve default entries for the Text Edit Boxes from run to run than holding those default entries in a separate file?&lt;/P&gt;&lt;P&gt;Here is my code so far: Any suggestion on improving any part of it?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here (1);

dt = Current Data Table ();

CList = dt &amp;lt;&amp;lt; get column names (string);

GList = {};


NCol = N Items (CList);

Try (dat = open("C:\AUTODAT.JMP", Invisible), 
		
		dat = new table ("AUTODAT", Invisible,
							Add Rows (2),
							New Column ("Entries", Character, Nominal, set values ({"NEW START", "NEW END"}))
								
						);
	);					
		
DefStart = column (dat, "Entries") [1];
DefEnd = column (dat, "Entries") [2];	

Dlg = New Window (" AUTO-GROUPING: ENTER SEARCH STRINGS", 
	
	&amp;lt;&amp;lt; Modal,
	Border Box (top (15), Bottom (15), Left (40), Right (40),
		V List Box (
			Text Box ("ENTER START STRING:"),
			ST = Text Edit Box (DefStart, Set Width (200)),
			
			Spacer Box (0,25),
			
			Text Box ("ENTER END STRING:"),
			ET = Text Edit Box (DefEnd, Set Width (200)),
			
			Spacer Box (0,25),
			
			Button Box ("OK", 
				StartString = ST &amp;lt;&amp;lt; Get Text ();
				EndString = ET &amp;lt;&amp;lt; Get Text ()
			),
			
			Button Box ("CANCEL", 
				Close( dat, NoSave );
				Throw (1))
		)
		
	)
);

Column (dat, "Entries")  &amp;lt;&amp;lt; set values (Eval List ({StartString, EndString}));

dat &amp;lt;&amp;lt; Save As ("C:\AUTODAT.JMP", 1);

Close (dat, NoSave);

Switch = ((Length (StartString) &amp;gt; 0) * 10) + (Length (EndString) &amp;gt; 0); 

For (i = 1, i &amp;lt;= NCol, i++,

	Match (Switch, 
			11,
			if(Starts With (CList [i], StartString) &amp;amp; Ends With (CList [i], EndString), 
				Insert into (GList, CList [i])),
			10,
			if(Starts With (CList [i], StartString), 
				Insert into (GList, CList [i])),
			1,	
			if(Ends With (CList [i], EndString), 
				Insert into (GList, CList [i])),
			0, Throw (1)
			)	
	
	
);


Group = dt &amp;lt;&amp;lt; Group Columns (GList);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Jun 2023 20:41:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-gt-Preserving-Default-Entries-for-Text-Edit-Box-Code/m-p/339483#M58769</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2023-06-10T20:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: JSL &gt; Preserving Default Entries for Text Edit Box: Code Improvement</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-gt-Preserving-Default-Entries-for-Text-Edit-Box-Code/m-p/339502#M58770</link>
      <description>&lt;P&gt;My standard way of handling what you are doing with a saved data table, is to save the values I need to save, as JSL.&amp;nbsp; I just create a text string with the required JSL to initialize the values and save it using Save Text File().&amp;nbsp; Then on subsequent runs, I just use an Include() to initialize the values.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Dec 2020 21:08:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-gt-Preserving-Default-Entries-for-Text-Edit-Box-Code/m-p/339502#M58770</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-12-05T21:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: JSL &gt; Preserving Default Entries for Text Edit Box: Code Improvement</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-gt-Preserving-Default-Entries-for-Text-Edit-Box-Code/m-p/339503#M58771</link>
      <description>Hi Jim,&lt;BR /&gt;Always on top of things and right on the money.&lt;BR /&gt;Thanks,&lt;BR /&gt;TS</description>
      <pubDate>Sat, 05 Dec 2020 21:12:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-gt-Preserving-Default-Entries-for-Text-Edit-Box-Code/m-p/339503#M58771</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2020-12-05T21:12:07Z</dc:date>
    </item>
  </channel>
</rss>

